diff options
author | danno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 12:43:14 +0000 |
---|---|---|
committer | danno@chromium.org <danno@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-09-22 12:43:14 +0000 |
commit | 37d5293518a8657af4d79035f7ef2e8c3a8d6b9a (patch) | |
tree | 9897f36b9f09457d3a5fbb002abc4e081e79ae56 /chrome/browser/background_mode_manager.cc | |
parent | 37c3dacaa38fddba1c53d9b3f3f0514933d3dd45 (diff) | |
download | chromium_src-37d5293518a8657af4d79035f7ef2e8c3a8d6b9a.zip chromium_src-37d5293518a8657af4d79035f7ef2e8c3a8d6b9a.tar.gz chromium_src-37d5293518a8657af4d79035f7ef2e8c3a8d6b9a.tar.bz2 |
Use PrefChangeRegistrar everywhere
BUG=54955
TEST=PrefChangeRegistrarTest.*
Review URL: http://codereview.chromium.org/3304015
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@60169 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/background_mode_manager.cc')
-rw-r--r-- | chrome/browser/background_mode_manager.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/chrome/browser/background_mode_manager.cc b/chrome/browser/background_mode_manager.cc index d675958..0882e4b 100644 --- a/chrome/browser/background_mode_manager.cc +++ b/chrome/browser/background_mode_manager.cc @@ -148,7 +148,8 @@ BackgroundModeManager::BackgroundModeManager(Profile* profile, NotificationService::AllSources()); // Listen for changes to the background mode preference. - profile_->GetPrefs()->AddPrefObserver(prefs::kBackgroundModeEnabled, this); + pref_registrar_.Init(profile_->GetPrefs()); + pref_registrar_.Add(prefs::kBackgroundModeEnabled, this); } BackgroundModeManager::~BackgroundModeManager() { @@ -157,10 +158,6 @@ 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() { |