| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_TAB_CONTENTS_NAVIGATION_METRICS_RECORDER_H_ | 5 #ifndef CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_METRICS_RECORDER_H_ |
| 6 #define CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_METRICS_RECORDER_H_ | 6 #define CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_METRICS_RECORDER_H_ |
| 7 | 7 |
| 8 #include "base/macros.h" | 8 #include "base/macros.h" |
| 9 #include "content/public/browser/web_contents_observer.h" | 9 #include "content/public/browser/web_contents_observer.h" |
| 10 #include "content/public/browser/web_contents_user_data.h" | 10 #include "content/public/browser/web_contents_user_data.h" |
| 11 | 11 |
| 12 namespace rappor { |
| 13 class RapporService; |
| 14 } |
| 15 |
| 12 class NavigationMetricsRecorder | 16 class NavigationMetricsRecorder |
| 13 : public content::WebContentsObserver, | 17 : public content::WebContentsObserver, |
| 14 public content::WebContentsUserData<NavigationMetricsRecorder> { | 18 public content::WebContentsUserData<NavigationMetricsRecorder> { |
| 15 public: | 19 public: |
| 16 ~NavigationMetricsRecorder() override; | 20 ~NavigationMetricsRecorder() override; |
| 17 | 21 |
| 22 void set_rappor_service_for_testing(rappor::RapporService* rappor_service); |
| 23 |
| 18 private: | 24 private: |
| 19 explicit NavigationMetricsRecorder(content::WebContents* web_contents); | 25 explicit NavigationMetricsRecorder(content::WebContents* web_contents); |
| 20 friend class content::WebContentsUserData<NavigationMetricsRecorder>; | 26 friend class content::WebContentsUserData<NavigationMetricsRecorder>; |
| 21 | 27 |
| 22 // content::WebContentsObserver overrides: | 28 // content::WebContentsObserver overrides: |
| 23 void DidNavigateMainFrame( | 29 void DidNavigateMainFrame( |
| 24 const content::LoadCommittedDetails& details, | 30 const content::LoadCommittedDetails& details, |
| 25 const content::FrameNavigateParams& params) override; | 31 const content::FrameNavigateParams& params) override; |
| 26 | 32 |
| 33 rappor::RapporService* rappor_service_; |
| 34 |
| 27 DISALLOW_COPY_AND_ASSIGN(NavigationMetricsRecorder); | 35 DISALLOW_COPY_AND_ASSIGN(NavigationMetricsRecorder); |
| 28 }; | 36 }; |
| 29 | 37 |
| 30 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_METRICS_RECORDER_H_ | 38 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_METRICS_RECORDER_H_ |
| OLD | NEW |