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 |
13 class GoogleURLTrackerNavigationHelperImpl | 17 class GoogleURLTrackerNavigationHelperImpl |
14 : public GoogleURLTrackerNavigationHelper, | 18 : public GoogleURLTrackerNavigationHelper, |
15 public content::NotificationObserver { | 19 public content::NotificationObserver { |
16 public: | 20 public: |
17 explicit GoogleURLTrackerNavigationHelperImpl(); | 21 GoogleURLTrackerNavigationHelperImpl(content::WebContents* web_contents, |
| 22 GoogleURLTracker* tracker); |
18 virtual ~GoogleURLTrackerNavigationHelperImpl(); | 23 virtual ~GoogleURLTrackerNavigationHelperImpl(); |
19 | 24 |
20 // GoogleURLTrackerNavigationHelper. | 25 // GoogleURLTrackerNavigationHelper: |
21 virtual void SetGoogleURLTracker(GoogleURLTracker* tracker) OVERRIDE; | |
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 // 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 // Returns a WebContents NavigationSource for the WebContents corresponding to | 39 content::WebContents* web_contents_; |
40 // the given NavigationController NotificationSource. | 40 content::NotificationRegistrar registrar_; |
41 virtual content::NotificationSource GetWebContentsSource( | |
42 const content::NotificationSource& nav_controller_source); | |
43 | 41 |
44 GoogleURLTracker* tracker_; | 42 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerNavigationHelperImpl); |
45 content::NotificationRegistrar registrar_; | |
46 }; | 43 }; |
47 | 44 |
48 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_IMPL_H_ | 45 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_NAVIGATION_HELPER_IMPL_H_ |
OLD | NEW |