summaryrefslogtreecommitdiffstats
path: root/chrome/browser/background_mode_manager.cc
diff options
context:
space:
mode:
authordanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-22 13:47:59 +0000
committerdanno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-09-22 13:47:59 +0000
commit2510323ec78d771c9258fa95d8f98b5d18f3efaa (patch)
tree2bbb6a5c3ebba6adf5f01982c75ba52275aadcc4 /chrome/browser/background_mode_manager.cc
parent37d5293518a8657af4d79035f7ef2e8c3a8d6b9a (diff)
downloadchromium_src-2510323ec78d771c9258fa95d8f98b5d18f3efaa.zip
chromium_src-2510323ec78d771c9258fa95d8f98b5d18f3efaa.tar.gz
chromium_src-2510323ec78d771c9258fa95d8f98b5d18f3efaa.tar.bz2
Revert 60169 - Use PrefChangeRegistrar everywhere
BUG=54955 TEST=PrefChangeRegistrarTest.* Review URL: http://codereview.chromium.org/3304015 TBR=danno@chromium.org git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60170 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/background_mode_manager.cc')
-rw-r--r--chrome/browser/background_mode_manager.cc7
1 files changed, 5 insertions, 2 deletions
diff --git a/chrome/browser/background_mode_manager.cc b/chrome/browser/background_mode_manager.cc
index 0882e4b..d675958 100644
--- a/chrome/browser/background_mode_manager.cc
+++ b/chrome/browser/background_mode_manager.cc
@@ -148,8 +148,7 @@ BackgroundModeManager::BackgroundModeManager(Profile* profile,
NotificationService::AllSources());
// Listen for changes to the background mode preference.
- pref_registrar_.Init(profile_->GetPrefs());
- pref_registrar_.Add(prefs::kBackgroundModeEnabled, this);
+ profile_->GetPrefs()->AddPrefObserver(prefs::kBackgroundModeEnabled, this);
}
BackgroundModeManager::~BackgroundModeManager() {
@@ -158,6 +157,10 @@ BackgroundModeManager::~BackgroundModeManager() {
// because in an actual running system we'd get an APP_TERMINATING
// notification before being destroyed.
EndBackgroundMode();
+ // Manually remove our pref observer so we don't get notified for prefs
+ // changes (have to do it manually because we can't use the registrar for
+ // prefs notifications).
+ profile_->GetPrefs()->RemovePrefObserver(prefs::kBackgroundModeEnabled, this);
}
bool BackgroundModeManager::IsBackgroundModeEnabled() {