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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
157 // The navigation handle holds relevant data for the navigation, but will | 157 // The navigation handle holds relevant data for the navigation, but will |
158 // be destroyed soon after this call. Don't hold a reference to it. This can | 158 // be destroyed soon after this call. Don't hold a reference to it. This can |
159 // be called multiple times. | 159 // be called multiple times. |
160 virtual void OnRedirect(content::NavigationHandle* navigation_handle) {} | 160 virtual void OnRedirect(content::NavigationHandle* navigation_handle) {} |
161 | 161 |
162 // OnCommit is triggered when a page load commits, i.e. when we receive the | 162 // OnCommit is triggered when a page load commits, i.e. when we receive the |
163 // first data for the request. The navigation handle holds relevant data for | 163 // first data for the request. The navigation handle holds relevant data for |
164 // the navigation, but will be destroyed soon after this call. Don't hold a | 164 // the navigation, but will be destroyed soon after this call. Don't hold a |
165 // reference to it. | 165 // reference to it. |
166 // Note that this does not get called for same page navigations. | 166 // Note that this does not get called for same page navigations. |
167 virtual void OnCommit(content::NavigationHandle* navigation_handle) {} | 167 // Observers that return STOP_OBSERVING will not receive any additional |
| 168 // callbacks, and will be deleted after invocation of this method returns. |
| 169 virtual ObservePolicy OnCommit(content::NavigationHandle* navigation_handle); |
168 | 170 |
169 // OnHidden is triggered when a page leaves the foreground. It does not fire | 171 // OnHidden is triggered when a page leaves the foreground. It does not fire |
170 // when a foreground page is permanently closed; for that, listen to | 172 // when a foreground page is permanently closed; for that, listen to |
171 // OnComplete instead. | 173 // OnComplete instead. |
172 virtual void OnHidden() {} | 174 virtual void OnHidden() {} |
173 | 175 |
174 // OnShown is triggered when a page is brought to the foreground. It does not | 176 // OnShown is triggered when a page is brought to the foreground. It does not |
175 // fire when the page first loads; for that, listen for OnStart instead. | 177 // fire when the page first loads; for that, listen for OnStart instead. |
176 virtual void OnShown() {} | 178 virtual void OnShown() {} |
177 | 179 |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // loads that result in downloads or 204s are aborted by the system, and are | 258 // loads that result in downloads or 204s are aborted by the system, and are |
257 // also included as failed provisional loads. | 259 // also included as failed provisional loads. |
258 virtual void OnFailedProvisionalLoad( | 260 virtual void OnFailedProvisionalLoad( |
259 const FailedProvisionalLoadInfo& failed_provisional_load_info, | 261 const FailedProvisionalLoadInfo& failed_provisional_load_info, |
260 const PageLoadExtraInfo& extra_info) {} | 262 const PageLoadExtraInfo& extra_info) {} |
261 }; | 263 }; |
262 | 264 |
263 } // namespace page_load_metrics | 265 } // namespace page_load_metrics |
264 | 266 |
265 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ | 267 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_PAGE_LOAD_METRICS_OBSERVER_H_ |
OLD | NEW |