OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CORE_OPTIONS_HANDLER_H_ | 5 #ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS_CORE_OPTIONS_HANDLER_H_ |
6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CORE_OPTIONS_HANDLER_H_ | 6 #define CHROME_BROWSER_UI_WEBUI_OPTIONS_CORE_OPTIONS_HANDLER_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
(...skipping 29 matching lines...) Expand all Loading... |
40 handlers_host_ = handlers_host; | 40 handlers_host_ = handlers_host; |
41 } | 41 } |
42 | 42 |
43 // Adds localized strings to |localized_strings|. | 43 // Adds localized strings to |localized_strings|. |
44 static void GetStaticLocalizedValues( | 44 static void GetStaticLocalizedValues( |
45 base::DictionaryValue* localized_strings); | 45 base::DictionaryValue* localized_strings); |
46 | 46 |
47 protected: | 47 protected: |
48 // Fetches a pref value of given |pref_name|. | 48 // Fetches a pref value of given |pref_name|. |
49 // Note that caller owns the returned Value. | 49 // Note that caller owns the returned Value. |
50 virtual Value* FetchPref(const std::string& pref_name); | 50 virtual base::Value* FetchPref(const std::string& pref_name); |
51 | 51 |
52 // Observes a pref of given |pref_name|. | 52 // Observes a pref of given |pref_name|. |
53 virtual void ObservePref(const std::string& pref_name); | 53 virtual void ObservePref(const std::string& pref_name); |
54 | 54 |
55 // Sets a pref |value| to given |pref_name|. | 55 // Sets a pref |value| to given |pref_name|. |
56 virtual void SetPref(const std::string& pref_name, | 56 virtual void SetPref(const std::string& pref_name, |
57 const Value* value, | 57 const base::Value* value, |
58 const std::string& metric); | 58 const std::string& metric); |
59 | 59 |
60 // Clears pref value for given |pref_name|. | 60 // Clears pref value for given |pref_name|. |
61 void ClearPref(const std::string& pref_name, const std::string& metric); | 61 void ClearPref(const std::string& pref_name, const std::string& metric); |
62 | 62 |
63 // Stops observing given preference identified by |path|. | 63 // Stops observing given preference identified by |path|. |
64 virtual void StopObservingPref(const std::string& path); | 64 virtual void StopObservingPref(const std::string& path); |
65 | 65 |
66 // Records a user metric action for the given value. | 66 // Records a user metric action for the given value. |
67 void ProcessUserMetric(const Value* value, | 67 void ProcessUserMetric(const base::Value* value, |
68 const std::string& metric); | 68 const std::string& metric); |
69 | 69 |
70 // Notifies registered JS callbacks on change in |pref_name| preference. | 70 // Notifies registered JS callbacks on change in |pref_name| preference. |
71 // |controlling_pref_name| controls if |pref_name| is managed by | 71 // |controlling_pref_name| controls if |pref_name| is managed by |
72 // policy/extension; empty |controlling_pref_name| indicates no other pref is | 72 // policy/extension; empty |controlling_pref_name| indicates no other pref is |
73 // controlling |pref_name|. | 73 // controlling |pref_name|. |
74 void NotifyPrefChanged(const std::string& pref_name, | 74 void NotifyPrefChanged(const std::string& pref_name, |
75 const std::string& controlling_pref_name); | 75 const std::string& controlling_pref_name); |
76 | 76 |
77 // Creates dictionary value for |pref|, |controlling_pref| controls if |pref| | 77 // Creates dictionary value for |pref|, |controlling_pref| controls if |pref| |
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
142 PrefChangeRegistrar registrar_; | 142 PrefChangeRegistrar registrar_; |
143 | 143 |
144 // Used for asynchronously updating the preference stating whether clearing | 144 // Used for asynchronously updating the preference stating whether clearing |
145 // LSO data is supported. | 145 // LSO data is supported. |
146 PluginDataRemoverHelper clear_plugin_lso_data_enabled_; | 146 PluginDataRemoverHelper clear_plugin_lso_data_enabled_; |
147 | 147 |
148 DISALLOW_COPY_AND_ASSIGN(CoreOptionsHandler); | 148 DISALLOW_COPY_AND_ASSIGN(CoreOptionsHandler); |
149 }; | 149 }; |
150 | 150 |
151 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CORE_OPTIONS_HANDLER_H_ | 151 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CORE_OPTIONS_HANDLER_H_ |
OLD | NEW |