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

Unified Diff: chrome/browser/background/background_mode_manager.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge to head for commit Created 8 years, 1 month 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/background/background_mode_manager.h ('k') | chrome/browser/browser_process_impl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/background/background_mode_manager.cc
diff --git a/chrome/browser/background/background_mode_manager.cc b/chrome/browser/background/background_mode_manager.cc
index 4fd087cb5db445b6236c7c506dc3b4acd98e6825..b77ba7e15f69684d4089161262ac0c5959683362 100644
--- a/chrome/browser/background/background_mode_manager.cc
+++ b/chrome/browser/background/background_mode_manager.cc
@@ -284,11 +284,6 @@ void BackgroundModeManager::Observe(
const content::NotificationSource& source,
const content::NotificationDetails& details) {
switch (type) {
- case chrome::NOTIFICATION_PREF_CHANGED:
- DCHECK(*content::Details<std::string>(details).ptr() ==
- prefs::kBackgroundModeEnabled);
- OnBackgroundModeEnabledPrefChanged();
- break;
case chrome::NOTIFICATION_EXTENSIONS_READY:
// Extensions are loaded, so we don't need to manually keep the browser
// process alive any more when running in no-startup-window mode.
@@ -341,6 +336,12 @@ void BackgroundModeManager::Observe(
}
}
+void BackgroundModeManager::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ DCHECK(pref_name == prefs::kBackgroundModeEnabled);
+ OnBackgroundModeEnabledPrefChanged();
+}
+
void BackgroundModeManager::OnBackgroundModeEnabledPrefChanged() {
if (IsBackgroundModePrefEnabled())
EnableBackgroundMode();
« no previous file with comments | « chrome/browser/background/background_mode_manager.h ('k') | chrome/browser/browser_process_impl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698