| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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 "components/infobars/core/infobar_manager.h" |
| 9 #include "content/public/browser/notification_registrar.h" | |
| 10 | 9 |
| 11 class GoogleURLTracker; | 10 class GoogleURLTracker; |
| 12 class GoogleURLTrackerInfoBarDelegate; | 11 class GoogleURLTrackerInfoBarDelegate; |
| 13 class InfoBarService; | 12 class InfoBarService; |
| 14 | 13 |
| 15 namespace content { | 14 namespace content { |
| 16 class NavigationController; | 15 class NavigationController; |
| 17 } | 16 } |
| 18 | 17 |
| 19 class GoogleURLTrackerMapEntry : public content::NotificationObserver { | 18 class GoogleURLTrackerMapEntry : public infobars::InfoBarManager::Observer { |
| 20 public: | 19 public: |
| 21 GoogleURLTrackerMapEntry( | 20 GoogleURLTrackerMapEntry( |
| 22 GoogleURLTracker* google_url_tracker, | 21 GoogleURLTracker* google_url_tracker, |
| 23 InfoBarService* infobar_service, | 22 InfoBarService* infobar_service, |
| 24 const content::NavigationController* navigation_controller); | 23 const content::NavigationController* navigation_controller); |
| 25 virtual ~GoogleURLTrackerMapEntry(); | 24 virtual ~GoogleURLTrackerMapEntry(); |
| 26 | 25 |
| 27 bool has_infobar_delegate() const { return !!infobar_delegate_; } | 26 bool has_infobar_delegate() const { return !!infobar_delegate_; } |
| 28 GoogleURLTrackerInfoBarDelegate* infobar_delegate() { | 27 GoogleURLTrackerInfoBarDelegate* infobar_delegate() { |
| 29 return infobar_delegate_; | 28 return infobar_delegate_; |
| 30 } | 29 } |
| 31 void SetInfoBarDelegate(GoogleURLTrackerInfoBarDelegate* infobar_delegate); | 30 void SetInfoBarDelegate(GoogleURLTrackerInfoBarDelegate* infobar_delegate); |
| 32 | 31 |
| 33 const content::NavigationController* navigation_controller() const { | 32 const content::NavigationController* navigation_controller() const { |
| 34 return navigation_controller_; | 33 return navigation_controller_; |
| 35 } | 34 } |
| 36 | 35 |
| 37 void Close(bool redo_search); | 36 void Close(bool redo_search); |
| 38 | 37 |
| 39 private: | 38 private: |
| 40 friend class GoogleURLTrackerTest; | 39 friend class GoogleURLTrackerTest; |
| 41 | 40 |
| 42 // content::NotificationObserver: | 41 // infobars::InfoBarManager::Observer implementation. |
| 43 virtual void Observe(int type, | 42 virtual void OnInfoBarRemoved(infobars::InfoBar* infobar, |
| 44 const content::NotificationSource& source, | 43 bool animate) OVERRIDE; |
| 45 const content::NotificationDetails& details) OVERRIDE; | 44 virtual void OnManagerShuttingDown( |
| 45 infobars::InfoBarManager* manager) OVERRIDE; |
| 46 | 46 |
| 47 content::NotificationRegistrar registrar_; | |
| 48 GoogleURLTracker* const google_url_tracker_; | 47 GoogleURLTracker* const google_url_tracker_; |
| 49 const InfoBarService* const infobar_service_; | 48 InfoBarService* const infobar_service_; |
| 50 GoogleURLTrackerInfoBarDelegate* infobar_delegate_; | 49 GoogleURLTrackerInfoBarDelegate* infobar_delegate_; |
| 51 const content::NavigationController* const navigation_controller_; | 50 const content::NavigationController* const navigation_controller_; |
| 51 bool observing_; |
| 52 | 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerMapEntry); | 53 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerMapEntry); |
| 54 }; | 54 }; |
| 55 | 55 |
| 56 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ | 56 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ |
| OLD | NEW |