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_ANDROID_PAGE_LOAD_METRICS_OBS
ERVER_H_ | 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ANDROID_PAGE_LOAD_METRICS_OBS
ERVER_H_ |
6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ANDROID_PAGE_LOAD_METRICS_OBS
ERVER_H_ | 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ANDROID_PAGE_LOAD_METRICS_OBS
ERVER_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" | 11 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" |
12 | 12 |
13 namespace content { | 13 namespace content { |
14 class WebContents; | 14 class WebContents; |
15 } // namespace content | 15 } // namespace content |
16 | 16 |
17 class GURL; | 17 class GURL; |
18 | 18 |
19 /** Forwards page load metrics to the Java side on Android. */ | 19 /** Forwards page load metrics to the Java side on Android. */ |
20 class AndroidPageLoadMetricsObserver | 20 class AndroidPageLoadMetricsObserver |
21 : public page_load_metrics::PageLoadMetricsObserver { | 21 : public page_load_metrics::PageLoadMetricsObserver { |
22 public: | 22 public: |
23 explicit AndroidPageLoadMetricsObserver(content::WebContents* web_contents); | 23 explicit AndroidPageLoadMetricsObserver(content::WebContents* web_contents); |
24 | 24 |
25 // page_load_metrics::PageLoadMetricsObserver: | 25 // page_load_metrics::PageLoadMetricsObserver: |
| 26 ObservePolicy OnStart(content::NavigationHandle* navigation_handle, |
| 27 const GURL& currently_committed_url, |
| 28 bool started_in_foreground) override; |
26 void OnFirstContentfulPaint( | 29 void OnFirstContentfulPaint( |
27 const page_load_metrics::PageLoadTiming& timing, | 30 const page_load_metrics::PageLoadTiming& timing, |
28 const page_load_metrics::PageLoadExtraInfo& extra_info) override; | 31 const page_load_metrics::PageLoadExtraInfo& extra_info) override; |
29 | 32 |
30 private: | 33 private: |
31 content::WebContents* web_contents_; | 34 content::WebContents* web_contents_; |
| 35 base::TimeTicks navigation_start_; |
32 | 36 |
33 DISALLOW_COPY_AND_ASSIGN(AndroidPageLoadMetricsObserver); | 37 DISALLOW_COPY_AND_ASSIGN(AndroidPageLoadMetricsObserver); |
34 }; | 38 }; |
35 | 39 |
36 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ANDROID_PAGE_LOAD_METRICS_
OBSERVER_H_ | 40 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_ANDROID_PAGE_LOAD_METRICS_
OBSERVER_H_ |
OLD | NEW |