Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(315)

Side by Side Diff: chrome/browser/tab_contents/navigation_metrics_recorder.h

Issue 10993064: Make using WebContentsUserData simpler. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "chrome/browser/tab_contents/web_contents_user_data.h" 8 #include "chrome/browser/common/web_contents_user_data.h"
9 #include "content/public/browser/web_contents_observer.h" 9 #include "content/public/browser/web_contents_observer.h"
10 10
11 class NavigationMetricsRecorder 11 class NavigationMetricsRecorder
12 : public content::WebContentsObserver, 12 : public content::WebContentsObserver,
13 public WebContentsUserData<NavigationMetricsRecorder> { 13 public WebContentsUserData<NavigationMetricsRecorder> {
14 public: 14 public:
15 virtual ~NavigationMetricsRecorder(); 15 virtual ~NavigationMetricsRecorder();
16 16
17 private: 17 private:
18 explicit NavigationMetricsRecorder(content::WebContents* web_contents); 18 explicit NavigationMetricsRecorder(content::WebContents* web_contents);
19 static int kUserDataKey;
20 friend class WebContentsUserData<NavigationMetricsRecorder>; 19 friend class WebContentsUserData<NavigationMetricsRecorder>;
21 20
22 // content::WebContentsObserver overrides: 21 // content::WebContentsObserver overrides:
23 virtual void DidNavigateMainFrame( 22 virtual void DidNavigateMainFrame(
24 const content::LoadCommittedDetails& details, 23 const content::LoadCommittedDetails& details,
25 const content::FrameNavigateParams& params) OVERRIDE; 24 const content::FrameNavigateParams& params) OVERRIDE;
26 25
27 DISALLOW_COPY_AND_ASSIGN(NavigationMetricsRecorder); 26 DISALLOW_COPY_AND_ASSIGN(NavigationMetricsRecorder);
28 }; 27 };
29 28
30 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_METRICS_RECORDER_H_ 29 #endif // CHROME_BROWSER_TAB_CONTENTS_NAVIGATION_METRICS_RECORDER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698