Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(216)

Unified Diff: chrome/browser/sync/glue/preference_change_processor.cc

Issue 3304015: Use PrefChangeRegistrar everywhere (Closed)
Patch Set: final version for commit Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/sync/glue/preference_change_processor.h ('k') | chrome/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/sync/glue/preference_change_processor.cc
diff --git a/chrome/browser/sync/glue/preference_change_processor.cc b/chrome/browser/sync/glue/preference_change_processor.cc
index ec0eeb35b5284930e3654da4dec16e3fe02038ec..874f786d084ac44d76ab1f5ca420e9df2694d7be 100644
--- a/chrome/browser/sync/glue/preference_change_processor.cc
+++ b/chrome/browser/sync/glue/preference_change_processor.cc
@@ -195,6 +195,7 @@ Value* PreferenceChangeProcessor::ReadPreference(
void PreferenceChangeProcessor::StartImpl(Profile* profile) {
DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
pref_service_ = profile->GetPrefs();
+ registrar_.Init(pref_service_);
StartObserving();
}
@@ -210,7 +211,7 @@ void PreferenceChangeProcessor::StartObserving() {
for (std::set<std::string>::const_iterator it =
model_associator_->synced_preferences().begin();
it != model_associator_->synced_preferences().end(); ++it) {
- pref_service_->AddPrefObserver((*it).c_str(), this);
+ registrar_.Add((*it).c_str(), this);
}
}
@@ -219,7 +220,7 @@ void PreferenceChangeProcessor::StopObserving() {
for (std::set<std::string>::const_iterator it =
model_associator_->synced_preferences().begin();
it != model_associator_->synced_preferences().end(); ++it) {
- pref_service_->RemovePrefObserver((*it).c_str(), this);
+ registrar_.Remove((*it).c_str(), this);
}
}
« no previous file with comments | « chrome/browser/sync/glue/preference_change_processor.h ('k') | chrome/browser/tab_contents/tab_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698