Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(227)

Unified Diff: webkit/glue/plugins/plugin_list.h

Issue 1085003: Implement chrome://plugins page that can disable plugins. (Closed)
Patch Set: merge ToT again Created 10 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webkit/glue/plugins/plugin_lib_posix.cc ('k') | webkit/glue/plugins/plugin_list.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webkit/glue/plugins/plugin_list.h
diff --git a/webkit/glue/plugins/plugin_list.h b/webkit/glue/plugins/plugin_list.h
index 00173998bdfbdcace98c4cad36e64707d59f6c8c..91bf23fd360d5bb8ad458de1c280f08e6dc0dace 100644
--- a/webkit/glue/plugins/plugin_list.h
+++ b/webkit/glue/plugins/plugin_list.h
@@ -5,6 +5,7 @@
#ifndef WEBKIT_GLUE_PLUGINS_PLUGIN_LIST_H_
#define WEBKIT_GLUE_PLUGINS_PLUGIN_LIST_H_
+#include <set>
#include <string>
#include <vector>
#include <set>
@@ -114,9 +115,12 @@ class PluginList {
// Shutdown all plugins. Should be called at process teardown.
void Shutdown();
- // Get all the plugins
+ // Get all the plugins.
void GetPlugins(bool refresh, std::vector<WebPluginInfo>* plugins);
+ // Get all the enabled plugins.
+ void GetEnabledPlugins(bool refresh, std::vector<WebPluginInfo>* plugins);
+
// Returns true if a plugin is found for the given url and mime type.
// The mime type which corresponds to the URL is optionally returned
// back.
@@ -137,6 +141,19 @@ class PluginList {
void LoadPlugin(const FilePath& filename,
std::vector<WebPluginInfo>* plugins);
+ // Enable a specific plugin, specified by path. Returns |true| iff a plugin
+ // currently in the plugin list was actually enabled as a result; regardless
+ // of return value, if a plugin is found in the future with the given name, it
+ // will be enabled. Note that plugins are enabled by default as far as
+ // |PluginList| is concerned.
+ bool EnablePlugin(const FilePath& filename);
+
+ // Disable a specific plugin, specified by path. Returns |true| iff a plugin
+ // currently in the plugin list was actually disabled as a result; regardless
+ // of return value, if a plugin is found in the future with the given name, it
+ // will be disabled.
+ bool DisablePlugin(const FilePath& filename);
+
private:
// Constructors are private for singletons
PluginList();
@@ -222,6 +239,9 @@ class PluginList {
// Holds information about internal plugins.
std::vector<PluginVersionInfo> internal_plugins_;
+ // Path names of plugins to disable (the default is to enable them all).
+ std::set<FilePath> disabled_plugins_;
+
// Need synchronization for the above members since this object can be
// accessed on multiple threads.
Lock lock_;
« no previous file with comments | « webkit/glue/plugins/plugin_lib_posix.cc ('k') | webkit/glue/plugins/plugin_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698