chromium/components/performance_manager/public/user_tuning/tab_revisit_tracker.h

// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_PERFORMANCE_MANAGER_PUBLIC_USER_TUNING_TAB_REVISIT_TRACKER_H_
#define COMPONENTS_PERFORMANCE_MANAGER_PUBLIC_USER_TUNING_TAB_REVISIT_TRACKER_H_

#include <map>
#include <optional>

#include "base/time/time.h"
#include "components/performance_manager/public/decorators/page_live_state_decorator.h"
#include "components/performance_manager/public/decorators/tab_page_decorator.h"
#include "components/performance_manager/public/graph/graph.h"
#include "components/performance_manager/public/graph/graph_registered.h"

namespace performance_manager {

// A GraphOwned object that tracks tab transitions to/from
// active/background/closed/discarded states and records timing information
// about these states.
class TabRevisitTracker : public TabPageObserver,
                          public PageLiveStateObserverDefaultImpl,
                          public PageNode::ObserverDefaultImpl,
                          public GraphOwnedAndRegistered<TabRevisitTracker> {};

}  // namespace performance_manager

#endif  // COMPONENTS_PERFORMANCE_MANAGER_PUBLIC_USER_TUNING_TAB_REVISIT_TRACKER_H_