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

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

Issue 11316163: Remove the last usages of PrefObserver outside of Prefs. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address review comments. Created 8 years 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.h
diff --git a/chrome/browser/ui/webui/options/core_options_handler.h b/chrome/browser/ui/webui/options/core_options_handler.h
index 8cf06f5347f60f1a03367cf936730d060ce78587..c307a116155d7c5e4172fe16a472532c5d48802c 100644
--- a/chrome/browser/ui/webui/options/core_options_handler.h
+++ b/chrome/browser/ui/webui/options/core_options_handler.h
@@ -10,7 +10,6 @@
#include "base/callback.h"
#include "base/prefs/public/pref_change_registrar.h"
-#include "base/prefs/public/pref_observer.h"
#include "base/values.h"
#include "chrome/browser/plugins/plugin_status_pref_setter.h"
#include "chrome/browser/prefs/pref_service.h"
@@ -20,8 +19,7 @@ namespace options {
// Core options UI handler.
// Handles resource and JS calls common to all options sub-pages.
-class CoreOptionsHandler : public OptionsPageUIHandler,
- public PrefObserver {
+class CoreOptionsHandler : public OptionsPageUIHandler {
public:
CoreOptionsHandler();
virtual ~CoreOptionsHandler();
@@ -32,10 +30,6 @@ class CoreOptionsHandler : public OptionsPageUIHandler,
virtual void InitializePage() OVERRIDE;
virtual void Uninitialize() OVERRIDE;
- // PrefObserver implementation.
- virtual void OnPreferenceChanged(PrefServiceBase* service,
- const std::string& pref_name) OVERRIDE;
-
// WebUIMessageHandler implementation.
virtual void RegisterMessages() OVERRIDE;
@@ -70,6 +64,13 @@ class CoreOptionsHandler : public OptionsPageUIHandler,
void ProcessUserMetric(const base::Value* value,
const std::string& metric);
+ // Virtual dispatch is needed as handling of some prefs may be
+ // finessed in subclasses. The PrefServiceBase pointer is included
+ // so that subclasses can know whether the observed pref is from the
+ // local state or not.
+ virtual void OnPreferenceChanged(PrefServiceBase* service,
+ const std::string& pref_name);
+
// Notifies registered JS callbacks on change in |pref_name| preference.
// |controlling_pref_name| controls if |pref_name| is managed by
// policy/extension; empty |controlling_pref_name| indicates no other pref is
« no previous file with comments | « chrome/browser/ui/webui/options/clear_browser_data_handler.cc ('k') | chrome/browser/ui/webui/options/core_options_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698