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 |