summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 23:19:13 +0000
committerviettrungluu@chromium.org <viettrungluu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-29 23:19:13 +0000
commit205764fceded73ccbddb93ccea16f521c04e752e (patch)
tree4135b8d1534535584dd5d0bc9ef8dd9ed830e096 /webkit
parent644362cf86a1b46f85e56c888cf2fd75eb9fb001 (diff)
downloadchromium_src-205764fceded73ccbddb93ccea16f521c04e752e.zip
chromium_src-205764fceded73ccbddb93ccea16f521c04e752e.tar.gz
chromium_src-205764fceded73ccbddb93ccea16f521c04e752e.tar.bz2
Properly disable plugins.
BUG=39737 TEST=about:plugins page should work properly on all platforms. E.g., with Flash installed, go to about:plugins and disable it. Then make sure Flash really doesn't run. Review URL: http://codereview.chromium.org/1570002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43014 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/plugin_list.cc6
-rw-r--r--webkit/glue/plugins/plugin_list.h9
2 files changed, 9 insertions, 6 deletions
diff --git a/webkit/glue/plugins/plugin_list.cc b/webkit/glue/plugins/plugin_list.cc
index a077b5f..f792174 100644
--- a/webkit/glue/plugins/plugin_list.cc
+++ b/webkit/glue/plugins/plugin_list.cc
@@ -273,7 +273,8 @@ bool PluginList::FindPlugin(const std::string& mime_type,
LoadPlugins(false);
AutoLock lock(lock_);
for (size_t i = 0; i < plugins_.size(); ++i) {
- if (SupportsType(plugins_[i], mime_type, allow_wildcard)) {
+ if (plugins_[i].enabled &&
+ SupportsType(plugins_[i], mime_type, allow_wildcard)) {
*info = plugins_[i];
return true;
}
@@ -295,7 +296,8 @@ bool PluginList::FindPlugin(const GURL &url,
std::string extension = StringToLowerASCII(std::string(path, last_dot+1));
for (size_t i = 0; i < plugins_.size(); ++i) {
- if (SupportsExtension(plugins_[i], extension, actual_mime_type)) {
+ if (plugins_[i].enabled &&
+ SupportsExtension(plugins_[i], extension, actual_mime_type)) {
*info = plugins_[i];
return true;
}
diff --git a/webkit/glue/plugins/plugin_list.h b/webkit/glue/plugins/plugin_list.h
index cad41f0..b80d83b 100644
--- a/webkit/glue/plugins/plugin_list.h
+++ b/webkit/glue/plugins/plugin_list.h
@@ -132,8 +132,8 @@ class PluginList {
WebPluginInfo* info,
std::string* actual_mime_type);
- // Get plugin info by plugin path. Returns true if the plugin is found and
- // WebPluginInfo has been filled in |info|.
+ // Get plugin info by plugin path (including disabled plugins). Returns true
+ // if the plugin is found and WebPluginInfo has been filled in |info|.
bool GetPluginInfoByPath(const FilePath& plugin_path,
WebPluginInfo* info);
@@ -175,14 +175,15 @@ class PluginList {
bool ShouldLoadPlugin(const WebPluginInfo& info,
std::vector<WebPluginInfo>* plugins);
- // Find a plugin by mime type.
+ // Find a plugin by mime type; only searches enabled plugins.
// The allow_wildcard parameter controls whether this function returns
// plugins which support wildcard mime types (* as the mime type)
bool FindPlugin(const std::string &mime_type,
bool allow_wildcard,
WebPluginInfo* info);
- // Find a plugin by extension. Returns the corresponding mime type.
+ // Find a plugin by extension; only searches enabled plugins. Returns the
+ // corresponding mime type.
bool FindPlugin(const GURL &url,
std::string* actual_mime_type,
WebPluginInfo* info);