OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_UKM_PAGE_LOAD_METRICS_OBSERVE
R_H_ |
| 6 #define CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_UKM_PAGE_LOAD_METRICS_OBSERVE
R_H_ |
| 7 |
| 8 #include "base/macros.h" |
| 9 #include "chrome/browser/page_load_metrics/page_load_metrics_observer.h" |
| 10 |
| 11 class UKMPageLoadMetricsObserver |
| 12 : public page_load_metrics::PageLoadMetricsObserver { |
| 13 public: |
| 14 // Returns a UKMPageLoadMetricsObserver, or nullptr if it is not needed. |
| 15 static std::unique_ptr<page_load_metrics::PageLoadMetricsObserver> |
| 16 CreateIfNeeded(); |
| 17 |
| 18 UKMPageLoadMetricsObserver(); |
| 19 // page_load_metrics::PageLoadMetricsObserver implementation: |
| 20 ObservePolicy OnStart(content::NavigationHandle* navigation_handle, |
| 21 const GURL& currently_committed_url, |
| 22 bool started_in_foreground) override; |
| 23 ObservePolicy OnHidden( |
| 24 const page_load_metrics::PageLoadTiming& timing, |
| 25 const page_load_metrics::PageLoadExtraInfo& extra_info) override; |
| 26 |
| 27 void OnComplete( |
| 28 const page_load_metrics::PageLoadTiming& timing, |
| 29 const page_load_metrics::PageLoadExtraInfo& extra_info) override; |
| 30 |
| 31 private: |
| 32 base::TimeTicks navigation_start_; |
| 33 |
| 34 DISALLOW_COPY_AND_ASSIGN(UKMPageLoadMetricsObserver); |
| 35 }; |
| 36 |
| 37 #endif // CHROME_BROWSER_PAGE_LOAD_METRICS_OBSERVERS_UKM_PAGE_LOAD_METRICS_OBSE
RVER_H_ |
OLD | NEW |