| 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 COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_WEB_CONTENTS_OBSE
RVER_H_ | 5 #ifndef COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_WEB_CONTENTS_OBSE
RVER_H_ |
| 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_WEB_CONTENTS_OBSE
RVER_H_ | 6 #define COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_WEB_CONTENTS_OBSE
RVER_H_ |
| 7 | 7 |
| 8 #include "base/containers/scoped_ptr_map.h" | 8 #include "base/containers/scoped_ptr_map.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/observer_list.h" | 10 #include "base/observer_list.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 namespace IPC { | 26 namespace IPC { |
| 27 class Message; | 27 class Message; |
| 28 } // namespace IPC | 28 } // namespace IPC |
| 29 | 29 |
| 30 namespace rappor { | 30 namespace rappor { |
| 31 class RapporService; | 31 class RapporService; |
| 32 } | 32 } |
| 33 | 33 |
| 34 namespace page_load_metrics { | 34 namespace page_load_metrics { |
| 35 | 35 |
| 36 // Returns true if the given URL matches a Google CAPTCHA page. |
| 37 bool IsGoogleCaptcha(const GURL& url); |
| 38 |
| 36 // These constants are for keeping the tests in sync. | 39 // These constants are for keeping the tests in sync. |
| 37 const char kHistogramNameFirstLayout[] = | 40 const char kHistogramNameFirstLayout[] = |
| 38 "PageLoad.Timing2.NavigationToFirstLayout"; | 41 "PageLoad.Timing2.NavigationToFirstLayout"; |
| 39 const char kHistogramNameFirstTextPaint[] = | 42 const char kHistogramNameFirstTextPaint[] = |
| 40 "PageLoad.Timing2.NavigationToFirstTextPaint"; | 43 "PageLoad.Timing2.NavigationToFirstTextPaint"; |
| 41 const char kHistogramNameDomContent[] = | 44 const char kHistogramNameDomContent[] = |
| 42 "PageLoad.Timing2.NavigationToDOMContentLoadedEventFired"; | 45 "PageLoad.Timing2.NavigationToDOMContentLoadedEventFired"; |
| 43 const char kHistogramNameLoad[] = "PageLoad.Timing2.NavigationToLoadEventFired"; | 46 const char kHistogramNameLoad[] = "PageLoad.Timing2.NavigationToLoadEventFired"; |
| 44 const char kBGHistogramNameFirstLayout[] = | 47 const char kBGHistogramNameFirstLayout[] = |
| 45 "PageLoad.Timing2.NavigationToFirstLayout.Background"; | 48 "PageLoad.Timing2.NavigationToFirstLayout.Background"; |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 void AddObserver(PageLoadMetricsObserver* observer) override; | 235 void AddObserver(PageLoadMetricsObserver* observer) override; |
| 233 void RemoveObserver(PageLoadMetricsObserver* observer) override; | 236 void RemoveObserver(PageLoadMetricsObserver* observer) override; |
| 234 | 237 |
| 235 // content::WebContentsObserver implementation: | 238 // content::WebContentsObserver implementation: |
| 236 bool OnMessageReceived(const IPC::Message& message, | 239 bool OnMessageReceived(const IPC::Message& message, |
| 237 content::RenderFrameHost* render_frame_host) override; | 240 content::RenderFrameHost* render_frame_host) override; |
| 238 void DidStartNavigation( | 241 void DidStartNavigation( |
| 239 content::NavigationHandle* navigation_handle) override; | 242 content::NavigationHandle* navigation_handle) override; |
| 240 void DidFinishNavigation( | 243 void DidFinishNavigation( |
| 241 content::NavigationHandle* navigation_handle) override; | 244 content::NavigationHandle* navigation_handle) override; |
| 245 void DidRedirectNavigation( |
| 246 content::NavigationHandle* navigation_handle) override; |
| 242 | 247 |
| 243 void WasShown() override; | 248 void WasShown() override; |
| 244 void WasHidden() override; | 249 void WasHidden() override; |
| 245 | 250 |
| 246 void RenderProcessGone(base::TerminationStatus status) override; | 251 void RenderProcessGone(base::TerminationStatus status) override; |
| 247 | 252 |
| 248 private: | 253 private: |
| 249 friend class content::WebContentsUserData<MetricsWebContentsObserver>; | 254 friend class content::WebContentsUserData<MetricsWebContentsObserver>; |
| 250 | 255 |
| 251 void OnTimingUpdated(content::RenderFrameHost*, const PageLoadTiming& timing); | 256 void OnTimingUpdated(content::RenderFrameHost*, const PageLoadTiming& timing); |
| (...skipping 11 matching lines...) Expand all Loading... |
| 263 | 268 |
| 264 rappor::RapporService* const rappor_service_; | 269 rappor::RapporService* const rappor_service_; |
| 265 base::ObserverList<PageLoadMetricsObserver, true> observers_; | 270 base::ObserverList<PageLoadMetricsObserver, true> observers_; |
| 266 | 271 |
| 267 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); | 272 DISALLOW_COPY_AND_ASSIGN(MetricsWebContentsObserver); |
| 268 }; | 273 }; |
| 269 | 274 |
| 270 } // namespace page_load_metrics | 275 } // namespace page_load_metrics |
| 271 | 276 |
| 272 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_WEB_CONTENTS_O
BSERVER_H_ | 277 #endif // COMPONENTS_PAGE_LOAD_METRICS_BROWSER_PAGE_LOAD_METRICS_WEB_CONTENTS_O
BSERVER_H_ |
| OLD | NEW |