summaryrefslogtreecommitdiffstats
path: root/content
diff options
context:
space:
mode:
authorsammc <sammc@chromium.org>2015-02-17 16:17:35 -0800
committerCommit bot <commit-bot@chromium.org>2015-02-18 00:18:37 +0000
commit75e8f0d96dbaaecae7aacbed53c5d666ad41c753 (patch)
treeaf039891942f9063b725cbb14613d7ea8fa0c0b0 /content
parent5a854d30eb6cae7ffa6a725d5257f027c153b7c0 (diff)
downloadchromium_src-75e8f0d96dbaaecae7aacbed53c5d666ad41c753.zip
chromium_src-75e8f0d96dbaaecae7aacbed53c5d666ad41c753.tar.gz
chromium_src-75e8f0d96dbaaecae7aacbed53c5d666ad41c753.tar.bz2
Enable plugin blocking for browser plugins.
This enables plugin blocking through content settings to function for the out of process PDF extension. This CL changes ChromeContentRendererClient to apply the same logic to browser plugins as it does to other plugin types. To enable this, this CL also moves the creation of browser plugins from RenderFrameImpl::createPlugin to RenderFrameImpl::CreatePlugin. Browser plugins using the "application/browser-plugin" MIME type (webview) are unaffected by this change. To avoid a nested blocked plugin, this also whitelists the PDF plugin to always be allowed within the PDF extension. BUG=454694 Review URL: https://codereview.chromium.org/920303003 Cr-Commit-Position: refs/heads/master@{#316707}
Diffstat (limited to 'content')
-rw-r--r--content/renderer/render_frame_impl.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index a0e63e3..17df925 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -1719,6 +1719,14 @@ blink::WebPlugin* RenderFrameImpl::CreatePlugin(
scoped_ptr<content::PluginInstanceThrottler> throttler) {
DCHECK_EQ(frame_, frame);
#if defined(ENABLE_PLUGINS)
+ if (info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) {
+ scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate(
+ GetContentClient()->renderer()->CreateBrowserPluginDelegate(
+ this, params.mimeType.utf8(), GURL(params.url)));
+ return BrowserPluginManager::Get()->CreateBrowserPlugin(
+ this, browser_plugin_delegate.Pass());
+ }
+
bool pepper_plugin_was_registered = false;
scoped_refptr<PluginModule> pepper_module(PluginModule::Create(
this, info, &pepper_plugin_was_registered));
@@ -1849,15 +1857,6 @@ blink::WebPlugin* RenderFrameImpl::createPlugin(
if (!found)
return NULL;
- if (info.type == WebPluginInfo::PLUGIN_TYPE_BROWSER_PLUGIN) {
- scoped_ptr<BrowserPluginDelegate> browser_plugin_delegate(
- GetContentClient()->renderer()->CreateBrowserPluginDelegate(
- this, mime_type, GURL(params.url)));
- return BrowserPluginManager::Get()->CreateBrowserPlugin(
- this, browser_plugin_delegate.Pass());
- }
-
-
WebPluginParams params_to_use = params;
params_to_use.mimeType = WebString::fromUTF8(mime_type);
return CreatePlugin(frame, info, params_to_use, nullptr /* throttler */);