Chromium Code Reviews| 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 23abda5a0819bf6dd95859243ac50748fd64db4d..05b5370386ee7e333b0df2211b2affa65b460600 100644 |
| --- a/components/page_load_metrics/browser/page_load_metrics_observer.h |
| +++ b/components/page_load_metrics/browser/page_load_metrics_observer.h |
| @@ -120,7 +120,8 @@ class PageLoadMetricsObserver { |
| // the navigation, but will be destroyed soon after this call. Don't hold a |
| // reference to it. |
| // Note that this does not get called for same page navigations. |
| - virtual void OnCommit(content::NavigationHandle* navigation_handle) {} |
| + virtual void OnCommit(content::NavigationHandle* navigation_handle, |
| + bool started_in_foreground) {} |
|
Charlie Harrison
2016/04/25 13:20:08
It makes more sense to thread this in OnStart. In
felt
2016/04/25 21:30:04
Do you mean making PageLoadMetricsObserver no long
Charlie Harrison
2016/04/25 21:49:11
Yeah that's what I meant. I wouldn't be opposed to
Bryan McQuade
2016/04/25 22:00:04
I'm open to either providing a getter for the curr
felt
2016/04/26 01:46:28
I personally prefer moving the boolean to OnStart,
|
| // OnFailedProvisionalLoad is triggered when a provisional load failed and did |
| // not commit. Note that provisional loads that result in downloads or 204s |
| @@ -128,6 +129,15 @@ class PageLoadMetricsObserver { |
| virtual void OnFailedProvisionalLoad( |
| content::NavigationHandle* navigation_handle) {} |
| + // 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 OnCommit instead. |
|
Bryan McQuade
2016/04/25 22:00:04
if we move the boolean to OnStart let's update thi
felt
2016/04/26 01:46:29
Done.
|
| + 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 |