OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_OBSERVERS_PREVIEWS_PAGE_LOAD_METRICS_OB
SERVER_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PREVIEWS_PAGE_LOAD_METRICS_OB
SERVER_H_ |
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PREVIEWS_PAGE_LOAD_METRICS_OB
SERVER_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PREVIEWS_PAGE_LOAD_METRICS_OB
SERVER_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" | 9 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" |
10 | 10 |
(...skipping 22 matching lines...) Expand all Loading... |
33 | 33 |
34 // Observer responsible for recording core page load metrics relevant to | 34 // Observer responsible for recording core page load metrics relevant to |
35 // Previews. | 35 // Previews. |
36 class PreviewsPageLoadMetricsObserver | 36 class PreviewsPageLoadMetricsObserver |
37 : public page_load_metrics::PageLoadMetricsObserver { | 37 : public page_load_metrics::PageLoadMetricsObserver { |
38 public: | 38 public: |
39 PreviewsPageLoadMetricsObserver(); | 39 PreviewsPageLoadMetricsObserver(); |
40 ~PreviewsPageLoadMetricsObserver() override; | 40 ~PreviewsPageLoadMetricsObserver() override; |
41 | 41 |
42 // page_load_metrics::PageLoadMetricsObserver: | 42 // page_load_metrics::PageLoadMetricsObserver: |
43 void OnCommit(content::NavigationHandle* navigation_handle) override; | 43 ObservePolicy OnCommit(content::NavigationHandle* navigation_handle) override; |
44 void OnDomContentLoadedEventStart( | 44 void OnDomContentLoadedEventStart( |
45 const page_load_metrics::PageLoadTiming& timing, | 45 const page_load_metrics::PageLoadTiming& timing, |
46 const page_load_metrics::PageLoadExtraInfo& info) override; | 46 const page_load_metrics::PageLoadExtraInfo& info) override; |
47 void OnLoadEventStart( | 47 void OnLoadEventStart( |
48 const page_load_metrics::PageLoadTiming& timing, | 48 const page_load_metrics::PageLoadTiming& timing, |
49 const page_load_metrics::PageLoadExtraInfo& info) override; | 49 const page_load_metrics::PageLoadExtraInfo& info) override; |
50 void OnFirstLayout(const page_load_metrics::PageLoadTiming& timing, | 50 void OnFirstLayout(const page_load_metrics::PageLoadTiming& timing, |
51 const page_load_metrics::PageLoadExtraInfo& info) override; | 51 const page_load_metrics::PageLoadExtraInfo& info) override; |
52 void OnFirstContentfulPaint( | 52 void OnFirstContentfulPaint( |
53 const page_load_metrics::PageLoadTiming& timing, | 53 const page_load_metrics::PageLoadTiming& timing, |
54 const page_load_metrics::PageLoadExtraInfo& info) override; | 54 const page_load_metrics::PageLoadExtraInfo& info) override; |
55 void OnParseStart(const page_load_metrics::PageLoadTiming& timing, | 55 void OnParseStart(const page_load_metrics::PageLoadTiming& timing, |
56 const page_load_metrics::PageLoadExtraInfo& info) override; | 56 const page_load_metrics::PageLoadExtraInfo& info) override; |
57 | 57 |
58 private: | 58 private: |
59 // Whether |web_contents| is showing an offline pages preview. Overridden in | 59 // Whether |web_contents| is showing an offline pages preview. Overridden in |
60 // testing. | 60 // testing. |
61 virtual bool IsOfflinePreview(content::WebContents* web_contents) const; | 61 virtual bool IsOfflinePreview(content::WebContents* web_contents) const; |
62 | 62 |
63 // Whether this page load was an offline pages preview. | |
64 bool is_offline_preview_; | |
65 | |
66 DISALLOW_COPY_AND_ASSIGN(PreviewsPageLoadMetricsObserver); | 63 DISALLOW_COPY_AND_ASSIGN(PreviewsPageLoadMetricsObserver); |
67 }; | 64 }; |
68 | 65 |
69 } // namespace previews | 66 } // namespace previews |
70 | 67 |
71 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PREVIEWS_PAGE_LOAD_METRICS
_OBSERVER_H_ | 68 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_PREVIEWS_PAGE_LOAD_METRICS
_OBSERVER_H_ |
OLD | NEW |