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 "url/gurl.h" | 11 #include "url/gurl.h" |
12 | 12 |
13 namespace content { | |
14 class WebContents; | |
15 } | |
16 | |
17 class GoogleURLTrackerNavigationHelperImpl | 13 class GoogleURLTrackerNavigationHelperImpl |
18 : public GoogleURLTrackerNavigationHelper, | 14 : public GoogleURLTrackerNavigationHelper, |
19 public content::NotificationObserver { | 15 public content::NotificationObserver { |
20 public: | 16 public: |
21 GoogleURLTrackerNavigationHelperImpl(content::WebContents* web_contents, | 17 explicit GoogleURLTrackerNavigationHelperImpl(); |
22 GoogleURLTracker* tracker); | |
23 virtual ~GoogleURLTrackerNavigationHelperImpl(); | 18 virtual ~GoogleURLTrackerNavigationHelperImpl(); |
24 | 19 |
25 // GoogleURLTrackerNavigationHelper: | 20 // GoogleURLTrackerNavigationHelper. |
| 21 virtual void SetGoogleURLTracker(GoogleURLTracker* tracker) OVERRIDE; |
26 virtual void SetListeningForNavigationCommit( | 22 virtual void SetListeningForNavigationCommit( |
| 23 const content::NavigationController* nav_controller, |
27 bool listen) OVERRIDE; | 24 bool listen) OVERRIDE; |
28 virtual bool IsListeningForNavigationCommit() OVERRIDE; | 25 virtual bool IsListeningForNavigationCommit( |
| 26 const content::NavigationController* nav_controller) OVERRIDE; |
29 virtual void SetListeningForTabDestruction( | 27 virtual void SetListeningForTabDestruction( |
| 28 const content::NavigationController* nav_controller, |
30 bool listen) OVERRIDE; | 29 bool listen) OVERRIDE; |
31 virtual bool IsListeningForTabDestruction() OVERRIDE; | 30 virtual bool IsListeningForTabDestruction( |
| 31 const content::NavigationController* nav_controller) OVERRIDE; |
32 | 32 |
33 private: | 33 private: |
34 // content::NotificationObserver: | 34 // content::NotificationObserver: |
35 virtual void Observe(int type, | 35 virtual void Observe(int type, |
36 const content::NotificationSource& source, | 36 const content::NotificationSource& source, |
37 const content::NotificationDetails& details) OVERRIDE; | 37 const content::NotificationDetails& details) OVERRIDE; |
38 | 38 |
39 content::WebContents* web_contents_; | 39 // Returns a WebContents NavigationSource for the WebContents corresponding to |
| 40 // the given NavigationController NotificationSource. |
| 41 virtual content::NotificationSource GetWebContentsSource( |
| 42 const content::NotificationSource& nav_controller_source); |
| 43 |
| 44 GoogleURLTracker* tracker_; |
40 content::NotificationRegistrar registrar_; | 45 content::NotificationRegistrar registrar_; |
41 | |
42 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerNavigationHelperImpl); | |
43 }; | 46 }; |
44 | 47 |
45 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_IMPL_H_ | 48 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_IMPL_H_ |
OLD | NEW |