summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
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,