summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorcpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-10 01:43:14 +0000
committercpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-04-10 01:43:14 +0000
commit8f5602c711b0ae644c8935a12f74429cd339c5ad (patch)
tree96f7467d50690a7342314b547620453ae0e2af39 /webkit
parent37f7c693be8f1c58f01e2bc06fbf31930fd6a7e1 (diff)
downloadchromium_src-8f5602c711b0ae644c8935a12f74429cd339c5ad.zip
chromium_src-8f5602c711b0ae644c8935a12f74429cd339c5ad.tar.gz
chromium_src-8f5602c711b0ae644c8935a12f74429cd339c5ad.tar.bz2
Bypass plugin installer if the plugin has been disabled
- Since we can't add strings just block the default_plugin to be used as the plugin to show when we can't find a pluging for a given mime type and the a matching plugin that is disabled is found. BUG=39718 TEST= see bug for details Review URL: http://codereview.chromium.org/1530029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@44176 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/plugin_list.cc20
-rw-r--r--webkit/glue/plugins/plugin_list.h5
2 files changed, 25 insertions, 0 deletions
diff --git a/webkit/glue/plugins/plugin_list.cc b/webkit/glue/plugins/plugin_list.cc
index 7514221..7640b0c63 100644
--- a/webkit/glue/plugins/plugin_list.cc
+++ b/webkit/glue/plugins/plugin_list.cc
@@ -287,6 +287,24 @@ bool PluginList::FindPlugin(const std::string& mime_type,
return false;
}
+bool PluginList::FindDisabledPlugin(const std::string& mime_type,
+ bool allow_wildcard,
+ WebPluginInfo* info) {
+ DCHECK(mime_type == StringToLowerASCII(mime_type));
+
+ LoadPlugins(false);
+ AutoLock lock(lock_);
+ for (size_t i = 0; i < plugins_.size(); ++i) {
+ if (!plugins_[i].enabled &&
+ SupportsType(plugins_[i], mime_type, allow_wildcard)) {
+ *info = plugins_[i];
+ return true;
+ }
+ }
+
+ return false;
+}
+
bool PluginList::FindPlugin(const GURL &url,
std::string* actual_mime_type,
WebPluginInfo* info) {
@@ -379,6 +397,8 @@ bool PluginList::GetPluginInfo(const GURL& url,
if (FindPlugin(url, actual_mime_type, &info2)) {
found = true;
*info = info2;
+ } else if (FindDisabledPlugin(mime_type, allow_wildcard, &info2)) {
+ found = false;
}
}
diff --git a/webkit/glue/plugins/plugin_list.h b/webkit/glue/plugins/plugin_list.h
index cff2dd2..f018346 100644
--- a/webkit/glue/plugins/plugin_list.h
+++ b/webkit/glue/plugins/plugin_list.h
@@ -182,6 +182,11 @@ class PluginList {
bool allow_wildcard,
WebPluginInfo* info);
+ // Just like |FindPlugin| but it only looks at the disabled plug-ins.
+ bool FindDisabledPlugin(const std::string &mime_type,
+ bool allow_wildcard,
+ WebPluginInfo* info);
+
// Find a plugin by extension; only searches enabled plugins. Returns the
// corresponding mime type.
bool FindPlugin(const GURL &url,