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