summaryrefslogtreecommitdiffstats
path: root/webkit
diff options
context:
space:
mode:
authorbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-30 13:34:05 +0000
committerbauerb@chromium.org <bauerb@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-30 13:34:05 +0000
commita651a3894ea39c788ac42e337b4abb5dd155e0fb (patch)
tree40a97130b154af29eeb84c05b09759bc26d32840 /webkit
parent23497d05d17671913682664b866824d0b09f30e4 (diff)
downloadchromium_src-a651a3894ea39c788ac42e337b4abb5dd155e0fb.zip
chromium_src-a651a3894ea39c788ac42e337b4abb5dd155e0fb.tar.gz
chromium_src-a651a3894ea39c788ac42e337b4abb5dd155e0fb.tar.bz2
Modify NPAPI::PluginList::GetPluginInfo() to return true also for disabled plugins.
GetPluginInfo() now returns true if the plugin is found, whether it's enabled or not. To find out whether the plugin is enabled, check the enabled flag in the WebPluginInfo struct output parameter. This enables getting information about disabled plugins. TEST=none BUG=none Review URL: http://codereview.chromium.org/2858035 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@51254 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'webkit')
-rw-r--r--webkit/glue/plugins/plugin_list.cc9
-rw-r--r--webkit/glue/plugins/plugin_list.h3
-rw-r--r--webkit/support/webkit_support.cc2
-rw-r--r--webkit/tools/test_shell/test_webview_delegate.cc2
4 files changed, 6 insertions, 10 deletions
diff --git a/webkit/glue/plugins/plugin_list.cc b/webkit/glue/plugins/plugin_list.cc
index 1ec170c..b40b519 100644
--- a/webkit/glue/plugins/plugin_list.cc
+++ b/webkit/glue/plugins/plugin_list.cc
@@ -381,13 +381,8 @@ bool PluginList::GetPluginInfo(const GURL& url,
std::string* actual_mime_type) {
bool found = FindPlugin(mime_type, allow_wildcard, info);
if (!found || (info->path.value() == kDefaultPluginLibraryName)) {
- WebPluginInfo info2;
- if (FindPlugin(url, actual_mime_type, &info2)) {
- found = true;
- *info = info2;
- } else if (FindDisabledPlugin(mime_type, allow_wildcard, &info2)) {
- found = false;
- }
+ found = FindPlugin(url, actual_mime_type, info) ||
+ FindDisabledPlugin(mime_type, allow_wildcard, info);
}
return found;
diff --git a/webkit/glue/plugins/plugin_list.h b/webkit/glue/plugins/plugin_list.h
index 7187ae2..ce9da28 100644
--- a/webkit/glue/plugins/plugin_list.h
+++ b/webkit/glue/plugins/plugin_list.h
@@ -125,7 +125,8 @@ class PluginList {
// 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.
+ // Returns true if a plugin is found for the given url and mime type
+ // (including disabled plugins, for which |info->enabled| is false).
// The mime type which corresponds to the URL is optionally returned
// back.
// The allow_wildcard parameter controls whether this function returns
diff --git a/webkit/support/webkit_support.cc b/webkit/support/webkit_support.cc
index 77237cc..f2ff347 100644
--- a/webkit/support/webkit_support.cc
+++ b/webkit/support/webkit_support.cc
@@ -176,7 +176,7 @@ WebPlugin* CreateWebPlugin(WebFrame* frame,
std::string actual_mime_type;
if (!NPAPI::PluginList::Singleton()->GetPluginInfo(
params.url, params.mimeType.utf8(), kAllowWildcard, &info,
- &actual_mime_type)) {
+ &actual_mime_type) || !info.enabled) {
return NULL;
}
diff --git a/webkit/tools/test_shell/test_webview_delegate.cc b/webkit/tools/test_shell/test_webview_delegate.cc
index cb434f4..8c27c3a 100644
--- a/webkit/tools/test_shell/test_webview_delegate.cc
+++ b/webkit/tools/test_shell/test_webview_delegate.cc
@@ -674,7 +674,7 @@ WebPlugin* TestWebViewDelegate::createPlugin(
std::string actual_mime_type;
if (!NPAPI::PluginList::Singleton()->GetPluginInfo(
params.url, params.mimeType.utf8(), allow_wildcard, &info,
- &actual_mime_type)) {
+ &actual_mime_type) || !info.enabled) {
return NULL;
}