summaryrefslogtreecommitdiffstats
path: root/chrome/browser/profile_impl.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/profile_impl.cc')
-rw-r--r--chrome/browser/profile_impl.cc15
1 files changed, 6 insertions, 9 deletions
diff --git a/chrome/browser/profile_impl.cc b/chrome/browser/profile_impl.cc
index 5a61e1c..f72a6a5 100644
--- a/chrome/browser/profile_impl.cc
+++ b/chrome/browser/profile_impl.cc
@@ -292,9 +292,10 @@ ProfileImpl::ProfileImpl(const FilePath& path)
&ProfileImpl::EnsureSessionServiceCreated);
PrefService* prefs = GetPrefs();
- prefs->AddPrefObserver(prefs::kSpellCheckDictionary, this);
- prefs->AddPrefObserver(prefs::kEnableSpellCheck, this);
- prefs->AddPrefObserver(prefs::kEnableAutoSpellCorrect, this);
+ pref_change_registrar_.Init(prefs);
+ pref_change_registrar_.Add(prefs::kSpellCheckDictionary, this);
+ pref_change_registrar_.Add(prefs::kEnableSpellCheck, this);
+ pref_change_registrar_.Add(prefs::kEnableAutoSpellCorrect, this);
#if defined(OS_MACOSX)
// If the profile directory doesn't already have a cache directory and it
@@ -390,7 +391,6 @@ void ProfileImpl::InitExtensions() {
extensions_service_ = new ExtensionsService(
this,
CommandLine::ForCurrentProcess(),
- GetPrefs(),
GetPath().AppendASCII(ExtensionsService::kInstallDirectoryName),
true);
@@ -501,11 +501,8 @@ ProfileImpl::~ProfileImpl() {
// The theme provider provides bitmaps to whoever wants them.
theme_provider_.reset();
- // Remove pref observers.
- PrefService* prefs = GetPrefs();
- prefs->RemovePrefObserver(prefs::kSpellCheckDictionary, this);
- prefs->RemovePrefObserver(prefs::kEnableSpellCheck, this);
- prefs->RemovePrefObserver(prefs::kEnableAutoSpellCorrect, this);
+ // Remove pref observers
+ pref_change_registrar_.RemoveAll();
// Delete the NTP resource cache so we can unregister pref observers.
ntp_resource_cache_.reset();