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/profile.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/profile.cc')
-rw-r--r-- | chrome/browser/profile.cc | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc index 5e1bbd3..bdbf4a0 100644 --- a/chrome/browser/profile.cc +++ b/chrome/browser/profile.cc @@ -113,7 +113,9 @@ class OffTheRecordProfileImpl : public Profile, // off-the-record window is closed, in which case we can clean our states // (cookies, downloads...). NotificationService::current()->AddObserver( - this, NOTIFY_BROWSER_CLOSED, NotificationService::AllSources()); + this, + NotificationType::BROWSER_CLOSED, + NotificationService::AllSources()); } virtual ~OffTheRecordProfileImpl() { @@ -127,7 +129,9 @@ class OffTheRecordProfileImpl : public Profile, request_context_ = NULL; } NotificationService::current()->RemoveObserver( - this, NOTIFY_BROWSER_CLOSED, NotificationService::AllSources()); + this, + NotificationType::BROWSER_CLOSED, + NotificationService::AllSources()); } virtual FilePath GetPath() { return profile_->GetPath(); } @@ -288,7 +292,7 @@ class OffTheRecordProfileImpl : public Profile, virtual void Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - DCHECK_EQ(NOTIFY_BROWSER_CLOSED, type); + DCHECK_EQ(NotificationType::BROWSER_CLOSED, type.value); // We are only interested in OTR browser closing. if (Source<Browser>(source)->profile() != this) return; @@ -547,7 +551,7 @@ URLRequestContext* ProfileImpl::GetRequestContext() { if (!default_request_context_) { default_request_context_ = request_context_; NotificationService::current()->Notify( - NOTIFY_DEFAULT_REQUEST_CONTEXT_AVAILABLE, + NotificationType::DEFAULT_REQUEST_CONTEXT_AVAILABLE, NotificationService::AllSources(), NotificationService::NoDetails()); } @@ -567,7 +571,7 @@ HistoryService* ProfileImpl::GetHistoryService(ServiceAccessType sat) { // Send out the notification that the history service was created. NotificationService::current()-> - Notify(NOTIFY_HISTORY_CREATED, Source<Profile>(this), + Notify(NotificationType::HISTORY_CREATED, Source<Profile>(this), Details<HistoryService>(history_service_.get())); } return history_service_.get(); @@ -702,7 +706,7 @@ class NotifySpellcheckerChangeTask : public Task { private: void Run(void) { NotificationService::current()->Notify( - NOTIFY_SPELLCHECKER_REINITIALIZED, + NotificationType::SPELLCHECKER_REINITIALIZED, Source<Profile>(profile_), Details<SpellcheckerReinitializedDetails>(&spellchecker_)); } @@ -785,7 +789,7 @@ void ProfileImpl::MarkAsCleanShutdown() { void ProfileImpl::Observe(NotificationType type, const NotificationSource& source, const NotificationDetails& details) { - if (NOTIFY_PREF_CHANGED == type) { + if (NotificationType::PREF_CHANGED == type) { std::wstring* pref_name_in = Details<std::wstring>(details).ptr(); PrefService* prefs = Source<PrefService>(source).ptr(); DCHECK(pref_name_in && prefs); |