OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #include "chrome/browser/ui/webui/plugins_ui.h" | 5 #include "chrome/browser/ui/webui/plugins_ui.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 // TODO(viettrungluu): Make plugin list updates notify, and then observe | 137 // TODO(viettrungluu): Make plugin list updates notify, and then observe |
138 // changes; maybe replumb plugin list through plugin service? | 138 // changes; maybe replumb plugin list through plugin service? |
139 // <http://crbug.com/39101> | 139 // <http://crbug.com/39101> |
140 class PluginsDOMHandler : public WebUIMessageHandler, | 140 class PluginsDOMHandler : public WebUIMessageHandler, |
141 public content::NotificationObserver { | 141 public content::NotificationObserver { |
142 public: | 142 public: |
143 PluginsDOMHandler(); | 143 PluginsDOMHandler(); |
144 virtual ~PluginsDOMHandler() {} | 144 virtual ~PluginsDOMHandler() {} |
145 | 145 |
146 // WebUIMessageHandler implementation. | 146 // WebUIMessageHandler implementation. |
147 virtual void RegisterMessages() OVERRIDE; | 147 virtual void RegisterMessages() override; |
148 | 148 |
149 // Callback for the "requestPluginsData" message. | 149 // Callback for the "requestPluginsData" message. |
150 void HandleRequestPluginsData(const base::ListValue* args); | 150 void HandleRequestPluginsData(const base::ListValue* args); |
151 | 151 |
152 // Callback for the "enablePlugin" message. | 152 // Callback for the "enablePlugin" message. |
153 void HandleEnablePluginMessage(const base::ListValue* args); | 153 void HandleEnablePluginMessage(const base::ListValue* args); |
154 | 154 |
155 // Callback for the "saveShowDetailsToPrefs" message. | 155 // Callback for the "saveShowDetailsToPrefs" message. |
156 void HandleSaveShowDetailsToPrefs(const base::ListValue* args); | 156 void HandleSaveShowDetailsToPrefs(const base::ListValue* args); |
157 | 157 |
158 // Calback for the "getShowDetails" message. | 158 // Calback for the "getShowDetails" message. |
159 void HandleGetShowDetails(const base::ListValue* args); | 159 void HandleGetShowDetails(const base::ListValue* args); |
160 | 160 |
161 // Callback for the "setPluginAlwaysAllowed" message. | 161 // Callback for the "setPluginAlwaysAllowed" message. |
162 void HandleSetPluginAlwaysAllowed(const base::ListValue* args); | 162 void HandleSetPluginAlwaysAllowed(const base::ListValue* args); |
163 | 163 |
164 // content::NotificationObserver method overrides | 164 // content::NotificationObserver method overrides |
165 virtual void Observe(int type, | 165 virtual void Observe(int type, |
166 const content::NotificationSource& source, | 166 const content::NotificationSource& source, |
167 const content::NotificationDetails& details) OVERRIDE; | 167 const content::NotificationDetails& details) override; |
168 | 168 |
169 private: | 169 private: |
170 void LoadPlugins(); | 170 void LoadPlugins(); |
171 | 171 |
172 // Called on the UI thread when the plugin information is ready. | 172 // Called on the UI thread when the plugin information is ready. |
173 void PluginsLoaded(const std::vector<WebPluginInfo>& plugins); | 173 void PluginsLoaded(const std::vector<WebPluginInfo>& plugins); |
174 | 174 |
175 content::NotificationRegistrar registrar_; | 175 content::NotificationRegistrar registrar_; |
176 | 176 |
177 // Holds grouped plug-ins. The key is the group identifier and | 177 // Holds grouped plug-ins. The key is the group identifier and |
(...skipping 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
516 void PluginsUI::RegisterProfilePrefs( | 516 void PluginsUI::RegisterProfilePrefs( |
517 user_prefs::PrefRegistrySyncable* registry) { | 517 user_prefs::PrefRegistrySyncable* registry) { |
518 registry->RegisterBooleanPref( | 518 registry->RegisterBooleanPref( |
519 prefs::kPluginsShowDetails, | 519 prefs::kPluginsShowDetails, |
520 false, | 520 false, |
521 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); | 521 user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF); |
522 registry->RegisterDictionaryPref( | 522 registry->RegisterDictionaryPref( |
523 prefs::kContentSettingsPluginWhitelist, | 523 prefs::kContentSettingsPluginWhitelist, |
524 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); | 524 user_prefs::PrefRegistrySyncable::SYNCABLE_PREF); |
525 } | 525 } |
OLD | NEW |