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_METRICS_WEB_CONTENTS_OBSERVER_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ |
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ |
7 | 7 |
8 #include <map> | 8 #include <map> |
9 #include <memory> | 9 #include <memory> |
10 #include <vector> | 10 #include <vector> |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 void HandleFailedNavigationForTrackedLoad( | 89 void HandleFailedNavigationForTrackedLoad( |
90 content::NavigationHandle* navigation_handle, | 90 content::NavigationHandle* navigation_handle, |
91 std::unique_ptr<PageLoadTracker> tracker); | 91 std::unique_ptr<PageLoadTracker> tracker); |
92 | 92 |
93 void HandleCommittedNavigationForTrackedLoad( | 93 void HandleCommittedNavigationForTrackedLoad( |
94 content::NavigationHandle* navigation_handle, | 94 content::NavigationHandle* navigation_handle, |
95 std::unique_ptr<PageLoadTracker> tracker); | 95 std::unique_ptr<PageLoadTracker> tracker); |
96 | 96 |
97 // Notify all loads, provisional and committed, that we performed an action | 97 // Notify all loads, provisional and committed, that we performed an action |
98 // that might abort them. | 98 // that might abort them. |
99 void NotifyAbortAllLoads(UserAbortType abort_type, bool user_initiated); | 99 void NotifyAbortAllLoads(UserAbortType abort_type, |
| 100 UserInitiatedInfo user_initiated_info); |
100 void NotifyAbortAllLoadsWithTimestamp(UserAbortType abort_type, | 101 void NotifyAbortAllLoadsWithTimestamp(UserAbortType abort_type, |
101 bool user_initiated, | 102 UserInitiatedInfo user_initiated_info, |
102 base::TimeTicks timestamp, | 103 base::TimeTicks timestamp, |
103 bool is_certainly_browser_timestamp); | 104 bool is_certainly_browser_timestamp); |
104 | 105 |
105 // Register / Unregister input event callback to given RenderViewHost | 106 // Register / Unregister input event callback to given RenderViewHost |
106 void RegisterInputEventObserver(content::RenderViewHost* host); | 107 void RegisterInputEventObserver(content::RenderViewHost* host); |
107 void UnregisterInputEventObserver(content::RenderViewHost* host); | 108 void UnregisterInputEventObserver(content::RenderViewHost* host); |
108 | 109 |
109 // Notify aborted provisional loads that a new navigation occurred. This is | 110 // Notify aborted provisional loads that a new navigation occurred. This is |
110 // used for more consistent attribution tracking for aborted provisional | 111 // used for more consistent attribution tracking for aborted provisional |
111 // loads. This method returns the provisional load that was likely aborted | 112 // loads. This method returns the provisional load that was likely aborted |
112 // by this navigation, to help instantiate the new PageLoadTracker. | 113 // by this navigation, to help instantiate the new PageLoadTracker. |
113 std::unique_ptr<PageLoadTracker> NotifyAbortedProvisionalLoadsNewNavigation( | 114 std::unique_ptr<PageLoadTracker> NotifyAbortedProvisionalLoadsNewNavigation( |
114 content::NavigationHandle* new_navigation); | 115 content::NavigationHandle* new_navigation, |
| 116 UserInitiatedInfo user_initiated_info); |
115 | 117 |
116 void OnTimingUpdated(content::RenderFrameHost*, | 118 void OnTimingUpdated(content::RenderFrameHost*, |
117 const PageLoadTiming& timing, | 119 const PageLoadTiming& timing, |
118 const PageLoadMetadata& metadata); | 120 const PageLoadMetadata& metadata); |
119 | 121 |
120 bool ShouldTrackNavigation( | 122 bool ShouldTrackNavigation( |
121 content::NavigationHandle* navigation_handle) const; | 123 content::NavigationHandle* navigation_handle) const; |
122 | 124 |
123 // True if the web contents is currently in the foreground. | 125 // True if the web contents is currently in the foreground. |
124 bool in_foreground_; | 126 bool in_foreground_; |
(...skipping 20 matching lines...) Expand all Loading... |
145 | 147 |
146 // Has the MWCO observed at least one navigation? | 148 // Has the MWCO observed at least one navigation? |
147 bool has_navigated_; | 149 bool has_navigated_; |
148 | 150 |
149 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); | 151 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); |
150 }; | 152 }; |
151 | 153 |
152 } // namespace page_load_metrics | 154 } // namespace page_load_metrics |
153 | 155 |
154 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ | 156 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_METRICS_WEB_CONTENTS_OBSERVER_H_ |
OLD | NEW |