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/tabs | |
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/tabs')
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.cc | 9 | ||||
-rw-r--r-- | chrome/browser/tabs/tab_strip_model.h | 2 |
2 files changed, 7 insertions, 4 deletions
diff --git a/chrome/browser/tabs/tab_strip_model.cc b/chrome/browser/tabs/tab_strip_model.cc index 5150938..8c5e8d2 100644 --- a/chrome/browser/tabs/tab_strip_model.cc +++ b/chrome/browser/tabs/tab_strip_model.cc @@ -17,6 +17,7 @@ #include "chrome/browser/metrics/user_metrics.h" #include "chrome/browser/tabs/tab_strip_model_order_controller.h" +#include "chrome/common/notification_service.h" #include "chrome/common/stl_util-inl.h" /////////////////////////////////////////////////////////////////////////////// @@ -30,7 +31,8 @@ TabStripModel::TabStripModel(TabStripModelDelegate* delegate, Profile* profile) order_controller_(NULL) { DCHECK(delegate_); NotificationService::current()->AddObserver(this, - NOTIFY_TAB_CONTENTS_DESTROYED, NotificationService::AllSources()); + NotificationType::TAB_CONTENTS_DESTROYED, + NotificationService::AllSources()); SetOrderController(new TabStripModelOrderController(this)); } @@ -38,7 +40,8 @@ TabStripModel::~TabStripModel() { STLDeleteContainerPointers(contents_data_.begin(), contents_data_.end()); delete order_controller_; NotificationService::current()->RemoveObserver(this, - NOTIFY_TAB_CONTENTS_DESTROYED, NotificationService::AllSources()); + NotificationType::TAB_CONTENTS_DESTROYED, + NotificationService::AllSources()); } void TabStripModel::AddObserver(TabStripModelObserver* observer) { @@ -482,7 +485,7 @@ std::vector<int> TabStripModel::GetIndexesOpenedBy(int index) const { void TabStripModel::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NOTIFY_TAB_CONTENTS_DESTROYED); + DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); // Sometimes, on qemu, it seems like a TabContents object can be destroyed // while we still have a reference to it. We need to break this reference // here so we don't crash later. diff --git a/chrome/browser/tabs/tab_strip_model.h b/chrome/browser/tabs/tab_strip_model.h index a6bf00f..9183b1b 100644 --- a/chrome/browser/tabs/tab_strip_model.h +++ b/chrome/browser/tabs/tab_strip_model.h @@ -8,7 +8,7 @@ #include <vector> #include "base/observer_list.h" -#include "chrome/common/notification_service.h" +#include "chrome/common/notification_observer.h" #include "chrome/common/page_transition_types.h" namespace gfx { |