| Index: chrome/browser/background_mode_manager.cc
|
| diff --git a/chrome/browser/background_mode_manager.cc b/chrome/browser/background_mode_manager.cc
|
| index 01a9a36bf6b8d0fdc5852ee1af044aa7dcad18ec..b0110a13b58fab779ff41989dceadde6d10e9e61 100644
|
| --- a/chrome/browser/background_mode_manager.cc
|
| +++ b/chrome/browser/background_mode_manager.cc
|
| @@ -163,7 +163,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() {
|
| @@ -172,10 +173,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() {
|
|
|