| 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> |
| 11 | 11 |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/plugin_data_remover_helper.h" |
| 13 #include "chrome/browser/prefs/pref_change_registrar.h" | 14 #include "chrome/browser/prefs/pref_change_registrar.h" |
| 14 #include "chrome/browser/ui/webui/options/options_ui.h" | 15 #include "chrome/browser/ui/webui/options/options_ui.h" |
| 15 | 16 |
| 16 // Core options UI handler. | 17 // Core options UI handler. |
| 17 // Handles resource and JS calls common to all options sub-pages. | 18 // Handles resource and JS calls common to all options sub-pages. |
| 18 class CoreOptionsHandler : public OptionsPageUIHandler { | 19 class CoreOptionsHandler : public OptionsPageUIHandler { |
| 19 public: | 20 public: |
| 20 CoreOptionsHandler(); | 21 CoreOptionsHandler(); |
| 21 virtual ~CoreOptionsHandler(); | 22 virtual ~CoreOptionsHandler(); |
| 22 | 23 |
| 23 // OptionsPageUIHandler implementation. | 24 // OptionsPageUIHandler implementation. |
| 25 virtual void Initialize(); |
| 24 virtual void GetLocalizedValues(DictionaryValue* localized_strings); | 26 virtual void GetLocalizedValues(DictionaryValue* localized_strings); |
| 25 virtual void Uninitialize(); | 27 virtual void Uninitialize(); |
| 26 | 28 |
| 27 // NotificationObserver implementation. | 29 // NotificationObserver implementation. |
| 28 virtual void Observe(NotificationType type, | 30 virtual void Observe(NotificationType type, |
| 29 const NotificationSource& source, | 31 const NotificationSource& source, |
| 30 const NotificationDetails& details); | 32 const NotificationDetails& details); |
| 31 | 33 |
| 32 // WebUIMessageHandler implementation. | 34 // WebUIMessageHandler implementation. |
| 33 virtual void RegisterMessages(); | 35 virtual void RegisterMessages(); |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 // value. |args| is an array of parameters as follows: | 97 // value. |args| is an array of parameters as follows: |
| 96 // item 0 - name of the preference. | 98 // item 0 - name of the preference. |
| 97 // item 1 - name of the metric identifier (optional). | 99 // item 1 - name of the metric identifier (optional). |
| 98 void HandleClearPref(const ListValue* args); | 100 void HandleClearPref(const ListValue* args); |
| 99 | 101 |
| 100 // Callback for the "coreOptionsUserMetricsAction" message. This records | 102 // Callback for the "coreOptionsUserMetricsAction" message. This records |
| 101 // an action that should be tracked if metrics recording is enabled. |args| | 103 // an action that should be tracked if metrics recording is enabled. |args| |
| 102 // is an array that contains a single item, the name of the metric identifier. | 104 // is an array that contains a single item, the name of the metric identifier. |
| 103 void HandleUserMetricsAction(const ListValue* args); | 105 void HandleUserMetricsAction(const ListValue* args); |
| 104 | 106 |
| 107 void UpdateClearPluginLSOData(); |
| 108 |
| 105 void NotifyPrefChanged(const std::string* pref_name); | 109 void NotifyPrefChanged(const std::string* pref_name); |
| 106 | 110 |
| 107 OptionsPageUIHandlerHost* handlers_host_; | 111 OptionsPageUIHandlerHost* handlers_host_; |
| 108 PrefChangeRegistrar registrar_; | 112 PrefChangeRegistrar registrar_; |
| 109 | 113 |
| 114 // Used for asynchronously updating the preference stating whether clearing |
| 115 // LSO data is supported. |
| 116 PluginDataRemoverHelper clear_plugin_lso_data_enabled_; |
| 117 |
| 110 DISALLOW_COPY_AND_ASSIGN(CoreOptionsHandler); | 118 DISALLOW_COPY_AND_ASSIGN(CoreOptionsHandler); |
| 111 }; | 119 }; |
| 112 | 120 |
| 113 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CORE_OPTIONS_HANDLER_H_ | 121 #endif // CHROME_BROWSER_UI_WEBUI_OPTIONS_CORE_OPTIONS_HANDLER_H_ |
| OLD | NEW |