#include "chrome/browser/page_load_metrics/observers/tab_strip_page_load_metrics_observer.h"
#include "base/metrics/histogram_functions.h"
#include "base/time/time.h"
#include "base/time/time_delta_from_string.h"
#if BUILDFLAG(IS_ANDROID)
#include "chrome/browser/ui/android/tab_model/tab_model.h"
#include "chrome/browser/ui/android/tab_model/tab_model_list.h"
#else
#include "chrome/browser/ui/browser.h"
#include "chrome/browser/ui/browser_list.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
#endif
#include "components/page_load_metrics/browser/metrics_web_contents_observer.h"
namespace internal {
const char kTabsActiveAbsolutePosition[] = …;
const char kTabsActiveRelativePosition[] = …;
const char kTabsPageLoadTimeSinceActive[] = …;
const char kTabsPageLoadTimeSinceCreated[] = …;
}
namespace {
std::vector<std::vector<content::WebContents*>> GetAllWebContents() { … }
void RecordTimeDeltaHistogram(const char histogram_name[],
base::TimeDelta value) { … }
}
TabStripPageLoadMetricsObserver::TabStripPageLoadMetricsObserver(
content::WebContents* web_contents) { … }
TabStripPageLoadMetricsObserver::~TabStripPageLoadMetricsObserver() = default;
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
TabStripPageLoadMetricsObserver::OnStart(
content::NavigationHandle* navigation_handle,
const GURL& currently_committed_url,
bool started_in_foreground) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
TabStripPageLoadMetricsObserver::OnPrerenderStart(
content::NavigationHandle* navigation_handle,
const GURL& currently_committed_url) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
TabStripPageLoadMetricsObserver::OnFencedFramesStart(
content::NavigationHandle* navigation_handle,
const GURL& currently_committed_url) { … }
page_load_metrics::PageLoadMetricsObserver::ObservePolicy
TabStripPageLoadMetricsObserver::OnShown() { … }