diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-01 18:16:56 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-02-01 18:16:56 +0000 |
commit | bfd04a62ce610d7bb61dbb78811dccbed23589b7 (patch) | |
tree | 70bb228c0f00ba1c12c584efd569daccf96b4026 /chrome/browser/views/infobars/infobar_container.cc | |
parent | a814d863440f0a154a7299f2d8b440f405c7700e (diff) | |
download | chromium_src-bfd04a62ce610d7bb61dbb78811dccbed23589b7.zip chromium_src-bfd04a62ce610d7bb61dbb78811dccbed23589b7.tar.gz chromium_src-bfd04a62ce610d7bb61dbb78811dccbed23589b7.tar.bz2 |
Remove most header file dependencies on the notification type list. It is
really painful to add more types, since lots of headers include the
notification service to derive from the notification observer. This splits that
out, so much less of the project should end up including notification_types.h
---Paths modified but not in any changelist:
Review URL: http://codereview.chromium.org/19744
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@9020 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/infobars/infobar_container.cc')
-rw-r--r-- | chrome/browser/views/infobars/infobar_container.cc | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/chrome/browser/views/infobars/infobar_container.cc b/chrome/browser/views/infobars/infobar_container.cc index d3d007f..35d7f7a 100644 --- a/chrome/browser/views/infobars/infobar_container.cc +++ b/chrome/browser/views/infobars/infobar_container.cc @@ -8,14 +8,13 @@ #include "chrome/browser/tab_contents/tab_contents.h" #include "chrome/browser/views/frame/browser_view.h" #include "chrome/browser/views/infobars/infobars.h" -#include "chrome/common/notification_types.h" +#include "chrome/common/notification_service.h" // InfoBarContainer, public: --------------------------------------------------- InfoBarContainer::InfoBarContainer(BrowserView* browser_view) : browser_view_(browser_view), tab_contents_(NULL) { - } InfoBarContainer::~InfoBarContainer() { @@ -29,10 +28,10 @@ InfoBarContainer::~InfoBarContainer() { void InfoBarContainer::ChangeTabContents(TabContents* contents) { if (tab_contents_) { NotificationService::current()->RemoveObserver( - this, NOTIFY_TAB_CONTENTS_INFOBAR_ADDED, + this, NotificationType::TAB_CONTENTS_INFOBAR_ADDED, Source<TabContents>(tab_contents_)); NotificationService::current()->RemoveObserver( - this, NOTIFY_TAB_CONTENTS_INFOBAR_REMOVED, + this, NotificationType::TAB_CONTENTS_INFOBAR_REMOVED, Source<TabContents>(tab_contents_)); } // No need to delete the child views here, their removal from the view @@ -42,10 +41,10 @@ void InfoBarContainer::ChangeTabContents(TabContents* contents) { if (tab_contents_) { UpdateInfoBars(); NotificationService::current()->AddObserver( - this, NOTIFY_TAB_CONTENTS_INFOBAR_ADDED, + this, NotificationType::TAB_CONTENTS_INFOBAR_ADDED, Source<TabContents>(tab_contents_)); NotificationService::current()->AddObserver( - this, NOTIFY_TAB_CONTENTS_INFOBAR_REMOVED, + this, NotificationType::TAB_CONTENTS_INFOBAR_REMOVED, Source<TabContents>(tab_contents_)); } } @@ -96,9 +95,9 @@ void InfoBarContainer::ViewHierarchyChanged(bool is_add, void InfoBarContainer::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - if (type == NOTIFY_TAB_CONTENTS_INFOBAR_ADDED) { + if (type == NotificationType::TAB_CONTENTS_INFOBAR_ADDED) { AddInfoBar(Details<InfoBarDelegate>(details).ptr()); - } else if (type == NOTIFY_TAB_CONTENTS_INFOBAR_REMOVED) { + } else if (type == NotificationType::TAB_CONTENTS_INFOBAR_REMOVED) { RemoveInfoBar(Details<InfoBarDelegate>(details).ptr()); } else { NOTREACHED(); |