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 WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ | 5 #ifndef WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ |
6 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ | 6 #define WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <utility> | 10 #include <utility> |
(...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 // of return value, if a plugin is found in the future with the given name, it | 186 // of return value, if a plugin is found in the future with the given name, it |
187 // will be disabled. | 187 // will be disabled. |
188 bool DisablePlugin(const FilePath& filename); | 188 bool DisablePlugin(const FilePath& filename); |
189 | 189 |
190 // Enable/disable a plugin group, specified by group_name. Returns |true| iff | 190 // Enable/disable a plugin group, specified by group_name. Returns |true| iff |
191 // a plugin currently in the plugin list was actually enabled/disabled as a | 191 // a plugin currently in the plugin list was actually enabled/disabled as a |
192 // result; regardless of return value, if a plugin is found in the future with | 192 // result; regardless of return value, if a plugin is found in the future with |
193 // the given name, it will be enabled/disabled. | 193 // the given name, it will be enabled/disabled. |
194 bool EnableGroup(bool enable, const string16& name); | 194 bool EnableGroup(bool enable, const string16& name); |
195 | 195 |
196 // Disable all plugins groups that are known to be outdated, according to | |
197 // the information hardcoded in PluginGroup, to make sure that they can't | |
198 // be loaded on a web page and instead show a UI to update to the latest | |
199 // version. | |
200 void DisableOutdatedPluginGroups(); | |
201 | |
202 virtual ~PluginList(); | 196 virtual ~PluginList(); |
203 | 197 |
204 protected: | 198 protected: |
205 // This constructor is used in unit tests to override the platform-dependent | 199 // This constructor is used in unit tests to override the platform-dependent |
206 // real-world plugin group definitions with custom ones. | 200 // real-world plugin group definitions with custom ones. |
207 PluginList(const PluginGroupDefinition* definitions, size_t num_definitions); | 201 PluginList(const PluginGroupDefinition* definitions, size_t num_definitions); |
208 | 202 |
209 // Adds the given WebPluginInfo to its corresponding group, creating it if | 203 // Adds the given WebPluginInfo to its corresponding group, creating it if |
210 // necessary, and returns the group. | 204 // necessary, and returns the group. |
211 // Callers need to protect calls to this method by a lock themselves. | 205 // Callers need to protect calls to this method by a lock themselves. |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
300 // Extra plugin directories that we want to search when loading. | 294 // Extra plugin directories that we want to search when loading. |
301 std::vector<FilePath> extra_plugin_dirs_; | 295 std::vector<FilePath> extra_plugin_dirs_; |
302 | 296 |
303 struct InternalPlugin { | 297 struct InternalPlugin { |
304 webkit::WebPluginInfo info; | 298 webkit::WebPluginInfo info; |
305 PluginEntryPoints entry_points; | 299 PluginEntryPoints entry_points; |
306 }; | 300 }; |
307 // Holds information about internal plugins. | 301 // Holds information about internal plugins. |
308 std::vector<InternalPlugin> internal_plugins_; | 302 std::vector<InternalPlugin> internal_plugins_; |
309 | 303 |
310 // If set to true outdated plugins are disabled in the end of LoadPlugins. | |
311 bool disable_outdated_plugins_; | |
312 | |
313 // Hardcoded plugin group definitions. | 304 // Hardcoded plugin group definitions. |
314 const PluginGroupDefinition* const group_definitions_; | 305 const PluginGroupDefinition* const group_definitions_; |
315 const size_t num_group_definitions_; | 306 const size_t num_group_definitions_; |
316 | 307 |
317 // Holds the currently available plugin groups. | 308 // Holds the currently available plugin groups. |
318 ScopedVector<PluginGroup> plugin_groups_; | 309 ScopedVector<PluginGroup> plugin_groups_; |
319 | 310 |
320 // The set of plugins that have been scheduled for disabling once they get | 311 // The set of plugins that have been scheduled for disabling once they get |
321 // loaded. This list is used in LoadPlugins and pruned after it. Contains | 312 // loaded. This list is used in LoadPlugins and pruned after it. Contains |
322 // plugins that were either disabled by the user (prefs are loaded before | 313 // plugins that were either disabled by the user (prefs are loaded before |
(...skipping 13 matching lines...) Expand all Loading... |
336 // Set to true if the default plugin is enabled. | 327 // Set to true if the default plugin is enabled. |
337 bool default_plugin_enabled_; | 328 bool default_plugin_enabled_; |
338 | 329 |
339 DISALLOW_COPY_AND_ASSIGN(PluginList); | 330 DISALLOW_COPY_AND_ASSIGN(PluginList); |
340 }; | 331 }; |
341 | 332 |
342 } // namespace npapi | 333 } // namespace npapi |
343 } // namespace webkit | 334 } // namespace webkit |
344 | 335 |
345 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ | 336 #endif // WEBKIT_PLUGINS_NPAPI_PLUGIN_LIST_H_ |
OLD | NEW |