Chromium Code Reviews| 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 29f1469925bd86d4f304a4737aa8bedcf960c298..24f9de4bf2e4d4efa895ebd211191ded726a894f 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))) { |
|
Fady Samuel
2013/03/18 18:48:05
Please merge with this https://codereview.chromium
|
| + return true; |
| } else { |
| return CommandLine::ForCurrentProcess()->HasSwitch( |
| switches::kEnableBrowserPluginForAllViewTypes); |