| Index: chrome/renderer/chrome_content_renderer_client.cc
|
| diff --git a/chrome/renderer/chrome_content_renderer_client.cc b/chrome/renderer/chrome_content_renderer_client.cc
|
| index 6a736799f033dcfdd0aa2918393ab172ceb0c8a5..56fe960b16f3d0e616da55875d37f6f1fecb567f 100644
|
| --- a/chrome/renderer/chrome_content_renderer_client.cc
|
| +++ b/chrome/renderer/chrome_content_renderer_client.cc
|
| @@ -131,6 +131,7 @@ using WebKit::WebVector;
|
| namespace {
|
|
|
| const char kWebViewTagName[] = "WEBVIEW";
|
| +const char kAdViewTagName[] = "ADVIEW";
|
|
|
| // Explicitly register all extension ManifestHandlers needed to parse
|
| // fields used in the renderer.
|
| @@ -400,6 +401,9 @@ bool ChromeContentRendererClient::OverrideCreatePlugin(
|
| if (extension && extension->HasAPIPermission(
|
| extensions::APIPermission::kWebView))
|
| return false;
|
| + if (extension && extension->HasAPIPermission(
|
| + extensions::APIPermission::kAdView))
|
| + return false;
|
| }
|
|
|
| ChromeViewHostMsg_GetPluginInfo_Output output;
|
| @@ -1105,14 +1109,14 @@ void ChromeContentRendererClient::RegisterPPAPIInterfaceFactories(
|
| bool ChromeContentRendererClient::AllowBrowserPlugin(
|
| WebKit::WebPluginContainer* container) const {
|
| // If this |BrowserPlugin| <object> in the |container| is not inside a
|
| - // <webview> shadowHost, we disable instantiating this plugin. This is to
|
| - // discourage and prevent developers from accidentally attaching <object>
|
| - // directly in apps.
|
| + // <webview>/<adview> shadowHost, we disable instantiating this plugin. This
|
| + // is to discourage and prevent developers from accidentally attaching
|
| + // <object> directly in apps.
|
| //
|
| // Note that this check below does *not* ensure any security, it is still
|
| // possible to bypass this check.
|
| // TODO(lazyboy): http://crbug.com/178663, Ensure we properly disallow
|
| - // instantiating BrowserPlugin outside of the <webview> shim.
|
| + // instantiating BrowserPlugin outside of the <webview>/<adview> shim.
|
| if (container->element().isNull())
|
| return false;
|
|
|
| @@ -1122,6 +1126,9 @@ bool ChromeContentRendererClient::AllowBrowserPlugin(
|
| if (container->element().shadowHost().tagName().equals(
|
| WebKit::WebString::fromUTF8(kWebViewTagName))) {
|
| return true;
|
| + } else if (container->element().shadowHost().tagName().equals(
|
| + WebKit::WebString::fromUTF8(kAdViewTagName))) {
|
| + return true;
|
| } else {
|
| return CommandLine::ForCurrentProcess()->HasSwitch(
|
| switches::kEnableBrowserPluginForAllViewTypes);
|
|
|