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_MAP_ENTRY_H_ | 5 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ |
6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ | 6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ |
7 | 7 |
8 #include "content/public/browser/notification_observer.h" | 8 #include "content/public/browser/notification_observer.h" |
9 #include "content/public/browser/notification_registrar.h" | 9 #include "content/public/browser/notification_registrar.h" |
10 | 10 |
11 class GoogleURLTracker; | 11 class GoogleURLTracker; |
12 class GoogleURLTrackerInfoBarDelegate; | 12 class GoogleURLTrackerInfoBarDelegate; |
| 13 class GoogleURLTrackerNavigationHelper; |
13 class InfoBarService; | 14 class InfoBarService; |
14 | 15 |
15 namespace content { | |
16 class NavigationController; | |
17 } | |
18 | |
19 class GoogleURLTrackerMapEntry : public content::NotificationObserver { | 16 class GoogleURLTrackerMapEntry : public content::NotificationObserver { |
20 public: | 17 public: |
21 GoogleURLTrackerMapEntry( | 18 GoogleURLTrackerMapEntry(GoogleURLTracker* google_url_tracker, |
22 GoogleURLTracker* google_url_tracker, | 19 InfoBarService* infobar_service, |
23 InfoBarService* infobar_service, | 20 GoogleURLTrackerNavigationHelper* navigation_helper); |
24 const content::NavigationController* navigation_controller); | |
25 virtual ~GoogleURLTrackerMapEntry(); | 21 virtual ~GoogleURLTrackerMapEntry(); |
26 | 22 |
27 bool has_infobar_delegate() const { return !!infobar_delegate_; } | 23 bool has_infobar_delegate() const { return !!infobar_delegate_; } |
28 GoogleURLTrackerInfoBarDelegate* infobar_delegate() { | 24 GoogleURLTrackerInfoBarDelegate* infobar_delegate() { |
29 return infobar_delegate_; | 25 return infobar_delegate_; |
30 } | 26 } |
31 void SetInfoBarDelegate(GoogleURLTrackerInfoBarDelegate* infobar_delegate); | 27 void SetInfoBarDelegate(GoogleURLTrackerInfoBarDelegate* infobar_delegate); |
32 | 28 |
33 const content::NavigationController* navigation_controller() const { | 29 GoogleURLTrackerNavigationHelper* navigation_helper() { |
34 return navigation_controller_; | 30 return navigation_helper_; |
35 } | 31 } |
36 | 32 |
37 void Close(bool redo_search); | 33 void Close(bool redo_search); |
38 | 34 |
39 private: | 35 private: |
40 friend class GoogleURLTrackerTest; | 36 friend class GoogleURLTrackerTest; |
41 | 37 |
42 // content::NotificationObserver: | 38 // content::NotificationObserver: |
43 virtual void Observe(int type, | 39 virtual void Observe(int type, |
44 const content::NotificationSource& source, | 40 const content::NotificationSource& source, |
45 const content::NotificationDetails& details) OVERRIDE; | 41 const content::NotificationDetails& details) OVERRIDE; |
46 | 42 |
47 content::NotificationRegistrar registrar_; | 43 content::NotificationRegistrar registrar_; |
48 GoogleURLTracker* const google_url_tracker_; | 44 GoogleURLTracker* const google_url_tracker_; |
49 const InfoBarService* const infobar_service_; | 45 const InfoBarService* const infobar_service_; |
50 GoogleURLTrackerInfoBarDelegate* infobar_delegate_; | 46 GoogleURLTrackerInfoBarDelegate* infobar_delegate_; |
51 const content::NavigationController* const navigation_controller_; | 47 GoogleURLTrackerNavigationHelper* navigation_helper_; |
52 | 48 |
53 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerMapEntry); | 49 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerMapEntry); |
54 }; | 50 }; |
55 | 51 |
56 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ | 52 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ |
OLD | NEW |