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/download/download_request_manager.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/download/download_request_manager.cc')
-rw-r--r-- | chrome/browser/download/download_request_manager.cc | 16 |
1 files changed, 9 insertions, 7 deletions
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<NavigationController> 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<NavigationController>(source).ptr() != controller_) { + if ((type != NotificationType::NAV_ENTRY_PENDING && + type != NotificationType::TAB_CLOSED) || + Source<NavigationController>(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; |