Chromium Code Reviews| 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_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_IMPL_H_ |
| 6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_IMPL_H_ | 6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_IMPL_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/google/google_url_tracker_navigation_helper.h" | 8 #include "chrome/browser/google/google_url_tracker_navigation_helper.h" |
| 9 #include "content/public/browser/notification_observer.h" | 9 #include "content/public/browser/notification_observer.h" |
| 10 #include "content/public/browser/notification_registrar.h" | 10 #include "content/public/browser/notification_registrar.h" |
| 11 #include "content/public/browser/web_contents_user_data.h" | |
| 11 #include "url/gurl.h" | 12 #include "url/gurl.h" |
| 12 | 13 |
| 13 class GoogleURLTrackerNavigationHelperImpl | 14 class GoogleURLTrackerNavigationHelperImpl |
| 14 : public GoogleURLTrackerNavigationHelper, | 15 : public GoogleURLTrackerNavigationHelper, |
| 15 public content::NotificationObserver { | 16 public content::NotificationObserver, |
| 17 public content::WebContentsUserData< | |
| 18 GoogleURLTrackerNavigationHelperImpl> { | |
| 16 public: | 19 public: |
| 17 explicit GoogleURLTrackerNavigationHelperImpl(); | |
| 18 virtual ~GoogleURLTrackerNavigationHelperImpl(); | 20 virtual ~GoogleURLTrackerNavigationHelperImpl(); |
| 19 | 21 |
| 20 // GoogleURLTrackerNavigationHelper. | 22 static void CreateForWebContentsAndTracker(content::WebContents* contents, |
| 21 virtual void SetGoogleURLTracker(GoogleURLTracker* tracker) OVERRIDE; | 23 GoogleURLTracker* tracker); |
| 24 | |
| 25 // GoogleURLTrackerNavigationHelper: | |
| 22 virtual void SetListeningForNavigationCommit( | 26 virtual void SetListeningForNavigationCommit( |
| 23 const content::NavigationController* nav_controller, | |
| 24 bool listen) OVERRIDE; | 27 bool listen) OVERRIDE; |
| 25 virtual bool IsListeningForNavigationCommit( | 28 virtual bool IsListeningForNavigationCommit() OVERRIDE; |
| 26 const content::NavigationController* nav_controller) OVERRIDE; | |
| 27 virtual void SetListeningForTabDestruction( | 29 virtual void SetListeningForTabDestruction( |
| 28 const content::NavigationController* nav_controller, | |
| 29 bool listen) OVERRIDE; | 30 bool listen) OVERRIDE; |
| 30 virtual bool IsListeningForTabDestruction( | 31 virtual bool IsListeningForTabDestruction() OVERRIDE; |
| 31 const content::NavigationController* nav_controller) OVERRIDE; | |
| 32 | 32 |
| 33 private: | 33 private: |
| 34 friend class content::WebContentsUserData< | |
| 35 GoogleURLTrackerNavigationHelperImpl>; | |
| 36 | |
| 37 GoogleURLTrackerNavigationHelperImpl(content::WebContents* web_contents, | |
| 38 GoogleURLTracker* tracker); | |
| 39 | |
| 34 // content::NotificationObserver: | 40 // content::NotificationObserver: |
| 35 virtual void Observe(int type, | 41 virtual void Observe(int type, |
| 36 const content::NotificationSource& source, | 42 const content::NotificationSource& source, |
| 37 const content::NotificationDetails& details) OVERRIDE; | 43 const content::NotificationDetails& details) OVERRIDE; |
| 38 | 44 |
| 39 // Returns a WebContents NavigationSource for the WebContents corresponding to | 45 content::WebContents* web_contents_; |
| 40 // the given NavigationController NotificationSource. | |
| 41 virtual content::NotificationSource GetWebContentsSource( | |
| 42 const content::NotificationSource& nav_controller_source); | |
| 43 | |
| 44 GoogleURLTracker* tracker_; | |
| 45 content::NotificationRegistrar registrar_; | 46 content::NotificationRegistrar registrar_; |
| 46 }; | 47 }; |
|
Peter Kasting
2014/05/15 21:29:52
Nit: While here: DISALLOW_COPY_AND_ASSIGN
blundell
2014/05/16 11:54:18
Done.
| |
| 47 | 48 |
| 48 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_IMPL_H_ | 49 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_IMPL_H_ |
| OLD | NEW |