summaryrefslogtreecommitdiffstats
path: root/chrome/browser/search_engines/template_url_model.cc
diff options
context:
space:
mode:
authorbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-01 18:16:56 +0000
committerbrettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-02-01 18:16:56 +0000
commitbfd04a62ce610d7bb61dbb78811dccbed23589b7 (patch)
tree70bb228c0f00ba1c12c584efd569daccf96b4026 /chrome/browser/search_engines/template_url_model.cc
parenta814d863440f0a154a7299f2d8b440f405c7700e (diff)
downloadchromium_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/search_engines/template_url_model.cc')
-rw-r--r--chrome/browser/search_engines/template_url_model.cc20
1 files changed, 11 insertions, 9 deletions
diff --git a/chrome/browser/search_engines/template_url_model.cc b/chrome/browser/search_engines/template_url_model.cc
index b328964..bfb9d43 100644
--- a/chrome/browser/search_engines/template_url_model.cc
+++ b/chrome/browser/search_engines/template_url_model.cc
@@ -17,6 +17,7 @@
#include "chrome/browser/search_engines/template_url.h"
#include "chrome/browser/search_engines/template_url_prepopulate_data.h"
#include "chrome/common/l10n_util.h"
+#include "chrome/common/notification_service.h"
#include "chrome/common/pref_names.h"
#include "chrome/common/pref_service.h"
#include "chrome/common/stl_util-inl.h"
@@ -92,10 +93,10 @@ TemplateURLModel::~TemplateURLModel() {
NotificationService* ns = NotificationService::current();
if (profile_) {
- ns->RemoveObserver(this, NOTIFY_HISTORY_URL_VISITED,
+ ns->RemoveObserver(this, NotificationType::HISTORY_URL_VISITED,
Source<Profile>(profile_->GetOriginalProfile()));
}
- ns->RemoveObserver(this, NOTIFY_GOOGLE_URL_UPDATED,
+ ns->RemoveObserver(this, NotificationType::GOOGLE_URL_UPDATED,
NotificationService::AllSources());
}
@@ -108,10 +109,10 @@ void TemplateURLModel::Init(const Initializer* initializers,
// db, which will mean we no longer need this notification and the history
// backend can handle automatically adding the search terms as the user
// navigates.
- ns->AddObserver(this, NOTIFY_HISTORY_URL_VISITED,
+ ns->AddObserver(this, NotificationType::HISTORY_URL_VISITED,
Source<Profile>(profile_->GetOriginalProfile()));
}
- ns->AddObserver(this, NOTIFY_GOOGLE_URL_UPDATED,
+ ns->AddObserver(this, NotificationType::GOOGLE_URL_UPDATED,
NotificationService::AllSources());
// Add specific initializers, if any.
@@ -686,14 +687,14 @@ void TemplateURLModel::RemoveDuplicatePrepopulateIDs(
void TemplateURLModel::Observe(NotificationType type,
const NotificationSource& source,
const NotificationDetails& details) {
- if (type == NOTIFY_HISTORY_URL_VISITED) {
+ if (type == NotificationType::HISTORY_URL_VISITED) {
Details<history::URLVisitedDetails> visit_details(details);
if (!loaded())
visits_to_add_.push_back(visit_details->row);
else
UpdateKeywordSearchTermsForURL(visit_details->row);
- } else if (type == NOTIFY_GOOGLE_URL_UPDATED) {
+ } else if (type == NotificationType::GOOGLE_URL_UPDATED) {
if (loaded_)
GoogleBaseURLChanged();
} else {
@@ -716,9 +717,10 @@ void TemplateURLModel::DeleteGeneratedKeywordsMatchingHost(
}
void TemplateURLModel::NotifyLoaded() {
- NotificationService::current()->
- Notify(TEMPLATE_URL_MODEL_LOADED, Source<TemplateURLModel>(this),
- NotificationService::NoDetails());
+ NotificationService::current()->Notify(
+ NotificationType::TEMPLATE_URL_MODEL_LOADED,
+ Source<TemplateURLModel>(this),
+ NotificationService::NoDetails());
}
void TemplateURLModel::MergeEnginesFromPrepopulateData() {