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

Unified Diff: chrome/browser/ui/webui/options/core_options_handler.cc

Issue 11345008: Remove content::NotificationObserver dependency from most Prefs code. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge LKGR. Created 8 years, 2 months 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
Index: chrome/browser/ui/webui/options/core_options_handler.cc
diff --git a/chrome/browser/ui/webui/options/core_options_handler.cc b/chrome/browser/ui/webui/options/core_options_handler.cc
index ea50be9b72e6d8223244400181195b9d1ba6fbbb..8e14ea1df858665de4a9063ac193524f3063a194 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.cc
+++ b/chrome/browser/ui/webui/options/core_options_handler.cc
@@ -135,22 +135,18 @@ void CoreOptionsHandler::Uninitialize() {
}
}
-void CoreOptionsHandler::Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) {
- if (type == chrome::NOTIFICATION_PREF_CHANGED) {
- std::string* pref_name = content::Details<std::string>(details).ptr();
- if (*pref_name == prefs::kClearPluginLSODataEnabled) {
- // This preference is stored in Local State, not in the user preferences.
- UpdateClearPluginLSOData();
- return;
- }
- if (*pref_name == prefs::kPepperFlashSettingsEnabled) {
- UpdatePepperFlashSettingsEnabled();
- return;
- }
- NotifyPrefChanged(*pref_name, std::string());
+void CoreOptionsHandler::OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name) {
+ if (pref_name == prefs::kClearPluginLSODataEnabled) {
+ // This preference is stored in Local State, not in the user preferences.
+ UpdateClearPluginLSOData();
+ return;
+ }
+ if (pref_name == prefs::kPepperFlashSettingsEnabled) {
+ UpdatePepperFlashSettingsEnabled();
+ return;
}
+ NotifyPrefChanged(pref_name, std::string());
}
void CoreOptionsHandler::RegisterMessages() {

Powered by Google App Engine
This is Rietveld 408576698