Index: chrome/browser/infobars/infobar_container.h |
diff --git a/chrome/browser/infobars/infobar_container.h b/chrome/browser/infobars/infobar_container.h |
index 6cfaacffe11deb645c78739d22fc7c1c31f6dd76..45bf70b98be1d04ced87de522b22c2fea6138365 100644 |
--- a/chrome/browser/infobars/infobar_container.h |
+++ b/chrome/browser/infobars/infobar_container.h |
@@ -9,21 +9,19 @@ |
#include "base/compiler_specific.h" |
#include "base/time/time.h" |
-#include "content/public/browser/notification_observer.h" |
-#include "content/public/browser/notification_registrar.h" |
+#include "chrome/browser/infobars/infobar_manager.h" |
#include "third_party/skia/include/core/SkColor.h" |
class InfoBar; |
-class InfoBarService; |
// InfoBarContainer is a cross-platform base class to handle the visibility- |
-// related aspects of InfoBars. While InfoBarService owns the InfoBars, the |
+// related aspects of InfoBars. While InfoBarManager owns the InfoBars, the |
// InfoBarContainer is responsible for telling particular InfoBars that they |
// should be hidden or visible. |
// |
// Platforms need to subclass this to implement a few platform-specific |
// functions, which are pure virtual here. |
-class InfoBarContainer : public content::NotificationObserver { |
+class InfoBarContainer : InfoBarManager::Observer { |
droger
2014/03/18 15:59:53
InfoBarContained now observes InfoBarManager inste
|
public: |
class Delegate { |
public: |
@@ -45,11 +43,11 @@ class InfoBarContainer : public content::NotificationObserver { |
explicit InfoBarContainer(Delegate* delegate); |
virtual ~InfoBarContainer(); |
- // Changes the InfoBarService for which this container is showing infobars. |
+ // Changes the InfoBarManager for which this container is showing infobars. |
// This will hide all current infobars, remove them from the container, add |
- // the infobars from |infobar_service|, and show them all. |infobar_service| |
+ // the infobars from |infobar_manager|, and show them all. |infobar_manager| |
// may be NULL. |
- void ChangeInfoBarService(InfoBarService* infobar_service); |
+ void ChangeInfoBarManager(InfoBarManager* infobar_manager); |
// Returns the amount by which to overlap the toolbar above, and, when |
// |total_height| is non-NULL, set it to the height of the InfoBarContainer |
@@ -101,10 +99,11 @@ class InfoBarContainer : public content::NotificationObserver { |
private: |
typedef std::vector<InfoBar*> InfoBars; |
- // content::NotificationObserver: |
- virtual void Observe(int type, |
- const content::NotificationSource& source, |
- const content::NotificationDetails& details) OVERRIDE; |
+ // InfoBarManager::Observer: |
+ virtual void OnInfoBarAdded(InfoBar* infobar) OVERRIDE; |
+ virtual void OnInfoBarReplaced(InfoBar* old_infobar, |
Peter Kasting
2014/03/18 18:29:17
Nit: Here and elsewhere, put these in alphabetical
|
+ InfoBar* new_infobar) OVERRIDE; |
+ virtual void OnInfoBarRemoved(InfoBar* infobar, bool animate) OVERRIDE; |
// Hides all infobars in this container without animation. |
void HideAllInfoBars(); |
@@ -123,9 +122,8 @@ class InfoBarContainer : public content::NotificationObserver { |
void UpdateInfoBarArrowTargetHeights(); |
int ArrowTargetHeightForInfoBar(size_t infobar_index) const; |
- content::NotificationRegistrar registrar_; |
Delegate* delegate_; |
- InfoBarService* infobar_service_; |
+ InfoBarManager* infobar_manager_; |
InfoBars infobars_; |
// Calculated in SetMaxTopArrowHeight(). |