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/alternate_nav_url_fetcher.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/alternate_nav_url_fetcher.cc')
-rw-r--r-- | chrome/browser/alternate_nav_url_fetcher.cc | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/chrome/browser/alternate_nav_url_fetcher.cc b/chrome/browser/alternate_nav_url_fetcher.cc index d7642b6..a124a1c 100644 --- a/chrome/browser/alternate_nav_url_fetcher.cc +++ b/chrome/browser/alternate_nav_url_fetcher.cc @@ -8,6 +8,7 @@ #include "chrome/browser/tab_contents/navigation_entry.h" #include "chrome/browser/tab_contents/web_contents.h" #include "chrome/common/l10n_util.h" +#include "chrome/common/notification_service.h" #include "chrome/common/resource_bundle.h" #include "generated_resources.h" @@ -20,24 +21,24 @@ AlternateNavURLFetcher::AlternateNavURLFetcher( state_(NOT_STARTED), navigated_to_entry_(false), infobar_contents_(NULL) { - registrar_.Add(this, NOTIFY_NAV_ENTRY_PENDING, + registrar_.Add(this, NotificationType::NAV_ENTRY_PENDING, NotificationService::AllSources()); } void AlternateNavURLFetcher::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - switch (type) { - case NOTIFY_NAV_ENTRY_PENDING: + switch (type.value) { + case NotificationType::NAV_ENTRY_PENDING: controller_ = Source<NavigationController>(source).ptr(); DCHECK(controller_->GetPendingEntry()); // Unregister for this notification now that we're pending, and start // listening for the corresponding commit. We also need to listen for the // tab close command since that means the load will never commit! - registrar_.Remove(this, NOTIFY_NAV_ENTRY_PENDING, + registrar_.Remove(this, NotificationType::NAV_ENTRY_PENDING, NotificationService::AllSources()); - registrar_.Add(this, NOTIFY_NAV_ENTRY_COMMITTED, + registrar_.Add(this, NotificationType::NAV_ENTRY_COMMITTED, Source<NavigationController>(controller_)); DCHECK_EQ(NOT_STARTED, state_); @@ -48,9 +49,9 @@ void AlternateNavURLFetcher::Observe(NotificationType type, fetcher_->Start(); break; - case NOTIFY_NAV_ENTRY_COMMITTED: + case NotificationType::NAV_ENTRY_COMMITTED: // The page was navigated, we can show the infobar now if necessary. - registrar_.Remove(this, NOTIFY_NAV_ENTRY_COMMITTED, + registrar_.Remove(this, NotificationType::NAV_ENTRY_COMMITTED, Source<NavigationController>(controller_)); navigated_to_entry_ = true; ShowInfobarIfPossible(); |