diff options
author | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-21 17:26:27 +0000 |
---|---|---|
committer | joi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-11-21 17:26:27 +0000 |
commit | 116129e0ed0d51eb7b6ff71b186605a0c58af5d8 (patch) | |
tree | 590bc0bbe134a3ffac78a6be8c61f3b8534f2c3e /chrome/browser/search_engines | |
parent | 920cfb47b33a1c32848fb2468647d7aea7ab89cb (diff) | |
download | chromium_src-116129e0ed0d51eb7b6ff71b186605a0c58af5d8.zip chromium_src-116129e0ed0d51eb7b6ff71b186605a0c58af5d8.tar.gz chromium_src-116129e0ed0d51eb7b6ff71b186605a0c58af5d8.tar.bz2 |
Remove PrefObserver usages, batch 11.
TBR=atwilson@chromium.org,stevet@chromium.org,hbono@chromium.org,erg@chromium.org,hans@chromium.org,mad@chromium.org
BUG=155525
Review URL: https://chromiumcodereview.appspot.com/11412127
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@169069 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/search_engines')
-rw-r--r-- | chrome/browser/search_engines/template_url_service.cc | 10 | ||||
-rw-r--r-- | chrome/browser/search_engines/template_url_service.h | 8 |
2 files changed, 8 insertions, 10 deletions
diff --git a/chrome/browser/search_engines/template_url_service.cc b/chrome/browser/search_engines/template_url_service.cc index 5ca0d7f..eeedce9 100644 --- a/chrome/browser/search_engines/template_url_service.cc +++ b/chrome/browser/search_engines/template_url_service.cc @@ -926,10 +926,8 @@ void TemplateURLService::Observe(int type, } } -void TemplateURLService::OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) { +void TemplateURLService::OnSyncedDefaultSearchProviderGUIDChanged() { // Listen for changes to the default search from Sync. - DCHECK_EQ(std::string(prefs::kSyncedDefaultSearchProviderGUID), pref_name); PrefService* prefs = GetPrefs(); TemplateURL* new_default_search = GetTemplateURLForGUID( prefs->GetString(prefs::kSyncedDefaultSearchProviderGUID)); @@ -1438,7 +1436,11 @@ void TemplateURLService::Init(const Initializer* initializers, notification_registrar_.Add(this, chrome::NOTIFICATION_GOOGLE_URL_UPDATED, profile_source); pref_change_registrar_.Init(GetPrefs()); - pref_change_registrar_.Add(prefs::kSyncedDefaultSearchProviderGUID, this); + pref_change_registrar_.Add( + prefs::kSyncedDefaultSearchProviderGUID, + base::Bind( + &TemplateURLService::OnSyncedDefaultSearchProviderGUIDChanged, + base::Unretained(this))); } notification_registrar_.Add(this, chrome::NOTIFICATION_DEFAULT_SEARCH_POLICY_CHANGED, diff --git a/chrome/browser/search_engines/template_url_service.h b/chrome/browser/search_engines/template_url_service.h index eea98e3..f2de45a 100644 --- a/chrome/browser/search_engines/template_url_service.h +++ b/chrome/browser/search_engines/template_url_service.h @@ -15,7 +15,6 @@ #include "base/memory/scoped_ptr.h" #include "base/observer_list.h" #include "base/prefs/public/pref_change_registrar.h" -#include "base/prefs/public/pref_observer.h" #include "chrome/browser/profiles/profile_keyed_service.h" #include "chrome/browser/search_engines/template_url_id.h" #include "chrome/browser/webdata/web_data_service.h" @@ -68,7 +67,6 @@ struct URLVisitedDetails; class TemplateURLService : public WebDataServiceConsumer, public ProfileKeyedService, public content::NotificationObserver, - public PrefObserver, public syncer::SyncableService { public: typedef std::map<std::string, std::string> QueryTerms; @@ -267,10 +265,6 @@ class TemplateURLService : public WebDataServiceConsumer, const content::NotificationSource& source, const content::NotificationDetails& details) OVERRIDE; - // PrefObserver implementation. - virtual void OnPreferenceChanged(PrefServiceBase* service, - const std::string& pref_name) OVERRIDE; - // syncer::SyncableService implementation. // Returns all syncable TemplateURLs from this model as SyncData. This should @@ -587,6 +581,8 @@ class TemplateURLService : public WebDataServiceConsumer, // where old entries were being pushed to Sync without a sync_guid. void PatchMissingSyncGUIDs(TemplateURLVector* template_urls); + void OnSyncedDefaultSearchProviderGUIDChanged(); + content::NotificationRegistrar notification_registrar_; PrefChangeRegistrar pref_change_registrar_; |