OLD | NEW |
(Empty) | |
| 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 |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ |
| 6 #define CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ |
| 7 |
| 8 #include "content/public/browser/notification_observer.h" |
| 9 #include "content/public/browser/notification_registrar.h" |
| 10 #include "content/public/browser/notification_source.h" |
| 11 |
| 12 class GoogleURLTracker; |
| 13 class GoogleURLTrackerInfoBarDelegate; |
| 14 class InfoBarTabHelper; |
| 15 |
| 16 class GoogleURLTrackerMapEntry : public content::NotificationObserver { |
| 17 public: |
| 18 GoogleURLTrackerMapEntry( |
| 19 GoogleURLTracker* google_url_tracker, |
| 20 InfoBarTabHelper* infobar_helper, |
| 21 const content::NotificationSource& navigation_controller_source, |
| 22 const content::NotificationSource& web_contents_source); |
| 23 virtual ~GoogleURLTrackerMapEntry(); |
| 24 |
| 25 bool has_infobar() const { return !!infobar_; } |
| 26 GoogleURLTrackerInfoBarDelegate* infobar() { return infobar_; } |
| 27 void SetInfoBar(GoogleURLTrackerInfoBarDelegate* infobar); |
| 28 |
| 29 const content::NotificationSource& navigation_controller_source() const { |
| 30 return navigation_controller_source_; |
| 31 } |
| 32 const content::NotificationSource& web_contents_source() const { |
| 33 return web_contents_source_; |
| 34 } |
| 35 |
| 36 void Close(bool redo_search); |
| 37 |
| 38 private: |
| 39 friend class GoogleURLTrackerTest; |
| 40 |
| 41 // content::NotificationObserver: |
| 42 virtual void Observe(int type, |
| 43 const content::NotificationSource& source, |
| 44 const content::NotificationDetails& details) OVERRIDE; |
| 45 |
| 46 content::NotificationRegistrar registrar_; |
| 47 GoogleURLTracker* const google_url_tracker_; |
| 48 const InfoBarTabHelper* const infobar_helper_; |
| 49 GoogleURLTrackerInfoBarDelegate* infobar_; |
| 50 const content::NotificationSource navigation_controller_source_; |
| 51 const content::NotificationSource web_contents_source_; |
| 52 |
| 53 DISALLOW_COPY_AND_ASSIGN(GoogleURLTrackerMapEntry); |
| 54 }; |
| 55 |
| 56 #endif // CHROME_BROWSER_GOOGLE_GOOGLE_URL_TRACKER_MAP_ENTRY_H_ |
OLD | NEW |