From bfd04a62ce610d7bb61dbb78811dccbed23589b7 Mon Sep 17 00:00:00 2001 From: "brettw@chromium.org" Date: Sun, 1 Feb 2009 18:16:56 +0000 Subject: 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 --- chrome/browser/views/tabs/dragged_tab_controller.cc | 17 ++++++++++------- chrome/browser/views/tabs/dragged_tab_controller.h | 2 +- 2 files changed, 11 insertions(+), 8 deletions(-) (limited to 'chrome/browser/views/tabs') diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index 4d35ad8..7464b92 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -17,6 +17,7 @@ #include "chrome/browser/views/tabs/tab_strip.h" #include "chrome/browser/tab_contents/web_contents.h" #include "chrome/common/animation.h" +#include "chrome/common/notification_service.h" #include "chrome/views/event.h" #include "chrome/views/root_view.h" #include "skia/include/SkBitmap.h" @@ -488,7 +489,7 @@ void DraggedTabController::UpdateTargetURL(TabContents* source, void DraggedTabController::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK(type == NOTIFY_TAB_CONTENTS_DESTROYED); + DCHECK(type == NotificationType::TAB_CONTENTS_DESTROYED); DCHECK(Source(source).ptr() == dragged_contents_); EndDragImpl(TAB_DESTROYED); } @@ -561,18 +562,20 @@ void DraggedTabController::UpdateDockInfo(const gfx::Point& screen_point) { void DraggedTabController::ChangeDraggedContents(TabContents* new_contents) { if (dragged_contents_) { - NotificationService::current()->RemoveObserver(this, - NOTIFY_TAB_CONTENTS_DESTROYED, - Source(dragged_contents_)); + NotificationService::current()->RemoveObserver( + this, + NotificationType::TAB_CONTENTS_DESTROYED, + Source(dragged_contents_)); if (original_delegate_) dragged_contents_->set_delegate(original_delegate_); } original_delegate_ = NULL; dragged_contents_ = new_contents; if (dragged_contents_) { - NotificationService::current()->AddObserver(this, - NOTIFY_TAB_CONTENTS_DESTROYED, - Source(dragged_contents_)); + NotificationService::current()->AddObserver( + this, + NotificationType::TAB_CONTENTS_DESTROYED, + Source(dragged_contents_)); // We need to be the delegate so we receive messages about stuff, // otherwise our dragged_contents() may be replaced and subsequently diff --git a/chrome/browser/views/tabs/dragged_tab_controller.h b/chrome/browser/views/tabs/dragged_tab_controller.h index 5c9730a..b03b0cb 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.h +++ b/chrome/browser/views/tabs/dragged_tab_controller.h @@ -12,7 +12,7 @@ #include "chrome/browser/tab_contents/tab_contents_delegate.h" #include "chrome/browser/tabs/tab_strip_model.h" #include "chrome/browser/views/tabs/tab_renderer.h" -#include "chrome/common/notification_service.h" +#include "chrome/common/notification_observer.h" namespace views { class MouseEvent; -- cgit v1.1