Index: components/page_load_metrics/browser/page_load_metrics_observer.h |
diff --git a/components/page_load_metrics/browser/page_load_metrics_observer.h b/components/page_load_metrics/browser/page_load_metrics_observer.h |
index b5e951f5cba965244f62b00df04e25c7acaaa9b6..f41085d53dc8c6bf1396636d372cabe4c21e2286 100644 |
--- a/components/page_load_metrics/browser/page_load_metrics_observer.h |
+++ b/components/page_load_metrics/browser/page_load_metrics_observer.h |
@@ -105,7 +105,8 @@ class PageLoadMetricsObserver { |
// initiated, or the empty URL if there was no committed page load at the time |
// the navigation was initiated. |
virtual void OnStart(content::NavigationHandle* navigation_handle, |
- const GURL& currently_committed_url) {} |
+ const GURL& currently_committed_url, |
+ bool started_in_foreground) {} |
// OnRedirect is triggered when a page load redirects to another URL. |
// The navigation handle holds relevant data for the navigation, but will |
@@ -134,6 +135,15 @@ class PageLoadMetricsObserver { |
virtual void OnTimingUpdate(const PageLoadTiming& timing, |
const PageLoadExtraInfo& extra_info) {} |
+ // OnHidden is triggered when a page leaves the foreground. It does not fire |
+ // when a foreground page is permanently closed; for that, listen to |
+ // OnComplete instead. |
+ virtual void OnHidden() {} |
+ |
+ // OnShown is triggered when a page is brought to the foreground. It does not |
+ // fire when the page first loads; for that, listen for OnStart instead. |
+ virtual void OnShown() {} |
+ |
// OnComplete is triggered when we are ready to record metrics for this page |
// load. This will happen some time after commit. The PageLoadTiming struct |
// contains timing data and the PageLoadExtraInfo struct contains other useful |