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