| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
| 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "base/optional.h" | 9 #include "base/optional.h" |
| 10 #include "chrome/common/page_load_metrics/page_load_timing.h" | 10 #include "chrome/common/page_load_metrics/page_load_timing.h" |
| (...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 // the navigation, but will be destroyed soon after this call. Don't hold a | 166 // the navigation, but will be destroyed soon after this call. Don't hold a |
| 167 // reference to it. | 167 // reference to it. |
| 168 // Note that this does not get called for same-page navigations. | 168 // Note that this does not get called for same-page navigations. |
| 169 // Observers that return STOP_OBSERVING will not receive any additional | 169 // Observers that return STOP_OBSERVING will not receive any additional |
| 170 // callbacks, and will be deleted after invocation of this method returns. | 170 // callbacks, and will be deleted after invocation of this method returns. |
| 171 virtual ObservePolicy OnCommit(content::NavigationHandle* navigation_handle); | 171 virtual ObservePolicy OnCommit(content::NavigationHandle* navigation_handle); |
| 172 | 172 |
| 173 // OnHidden is triggered when a page leaves the foreground. It does not fire | 173 // OnHidden is triggered when a page leaves the foreground. It does not fire |
| 174 // when a foreground page is permanently closed; for that, listen to | 174 // when a foreground page is permanently closed; for that, listen to |
| 175 // OnComplete instead. | 175 // OnComplete instead. |
| 176 virtual ObservePolicy OnHidden(); | 176 virtual ObservePolicy OnHidden(const PageLoadTiming& timing, |
| 177 const PageLoadExtraInfo& extra_info); |
| 177 | 178 |
| 178 // OnShown is triggered when a page is brought to the foreground. It does not | 179 // OnShown is triggered when a page is brought to the foreground. It does not |
| 179 // fire when the page first loads; for that, listen for OnStart instead. | 180 // fire when the page first loads; for that, listen for OnStart instead. |
| 180 virtual ObservePolicy OnShown(); | 181 virtual ObservePolicy OnShown(); |
| 181 | 182 |
| 182 // The callbacks below are only invoked after a navigation commits, for | 183 // The callbacks below are only invoked after a navigation commits, for |
| 183 // tracked page loads. Page loads that don't meet the criteria for being | 184 // tracked page loads. Page loads that don't meet the criteria for being |
| 184 // tracked at the time a navigation commits will not receive any of the | 185 // tracked at the time a navigation commits will not receive any of the |
| 185 // callbacks below. | 186 // callbacks below. |
| 186 | 187 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 // OnFailedProvisionalLoad is invoked for tracked page loads that did not | 261 // OnFailedProvisionalLoad is invoked for tracked page loads that did not |
| 261 // commit, immediately before the observer is deleted. | 262 // commit, immediately before the observer is deleted. |
| 262 virtual void OnFailedProvisionalLoad( | 263 virtual void OnFailedProvisionalLoad( |
| 263 const FailedProvisionalLoadInfo& failed_provisional_load_info, | 264 const FailedProvisionalLoadInfo& failed_provisional_load_info, |
| 264 const PageLoadExtraInfo& extra_info) {} | 265 const PageLoadExtraInfo& extra_info) {} |
| 265 }; | 266 }; |
| 266 | 267 |
| 267 } // namespace page_load_metrics | 268 } // namespace page_load_metrics |
| 268 | 269 |
| 269 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 270 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
| OLD | NEW |