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/download/download_request_manager.cc | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'chrome/browser/download/download_request_manager.cc') diff --git a/chrome/browser/download/download_request_manager.cc b/chrome/browser/download/download_request_manager.cc index 9410cd3..af6a22c 100644 --- a/chrome/browser/download/download_request_manager.cc +++ b/chrome/browser/download/download_request_manager.cc @@ -161,8 +161,9 @@ DownloadRequestManager::TabDownloadState::TabDownloadState( status_(DownloadRequestManager::ALLOW_ONE_DOWNLOAD), dialog_delegate_(NULL) { Source notification_source(controller); - registrar_.Add(this, NOTIFY_NAV_ENTRY_PENDING, notification_source); - registrar_.Add(this, NOTIFY_TAB_CLOSED, notification_source); + registrar_.Add(this, NotificationType::NAV_ENTRY_PENDING, + notification_source); + registrar_.Add(this, NotificationType::TAB_CLOSED, notification_source); NavigationEntry* active_entry = originating_controller ? originating_controller->GetActiveEntry() : controller->GetActiveEntry(); @@ -219,14 +220,15 @@ void DownloadRequestManager::TabDownloadState::Observe( NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - if ((type != NOTIFY_NAV_ENTRY_PENDING && type != NOTIFY_TAB_CLOSED) || - Source(source).ptr() != controller_) { + if ((type != NotificationType::NAV_ENTRY_PENDING && + type != NotificationType::TAB_CLOSED) || + Source(source).ptr() != controller_) { NOTREACHED(); return; } - switch(type) { - case NOTIFY_NAV_ENTRY_PENDING: { + switch(type.value) { + case NotificationType::NAV_ENTRY_PENDING: { // NOTE: resetting state on a pending navigate isn't ideal. In particular // it is possible that queued up downloads for the page before the // pending navigate will be delivered to us after we process this @@ -261,7 +263,7 @@ void DownloadRequestManager::TabDownloadState::Observe( break; } - case NOTIFY_TAB_CLOSED: + case NotificationType::TAB_CLOSED: // Tab closed, no need to handle closing the dialog as it's owned by the // TabContents, break so that we get deleted after switch. break; -- cgit v1.1