Chromium Code Reviews| 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..5beae9dd0651131ad3fa88ad1c5c174e58f3f3b3 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); |
| + // We need to use virtual dispatch as handling of some prefs may be |
| + // finessed in subclasses. We need to include the PrefServiceBase |
| + // pointer so that subclasses can know whether we are observing the |
| + // pref from the local state or not. |
|
Mattias Nissler (ping if slow)
2012/12/04 10:47:12
Some people feel strongly about avoiding use of pr
Jói
2012/12/04 10:55:57
The rest of the comments in this file seem to avoi
|
| + 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 |