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 b7814592f2b28dab52ffb6676546c2535c18f6f7..94256009499007a96e25c104f031691424d2fd6a 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. |
| @@ -401,6 +402,9 @@ bool ChromeContentRendererClient::OverrideCreatePlugin( |
| if (extension && extension->HasAPIPermission( |
| extensions::APIPermission::kWebView)) |
| return false; |
| + if (extension && extension->HasAPIPermission( |
|
darin (slow to review)
2013/03/19 20:20:03
nit: only need to null check |extension| once, rig
rpaquay
2013/03/19 20:45:29
Done.
|
| + extensions::APIPermission::kAdView)) |
| + return false; |
| } |
| ChromeViewHostMsg_GetPluginInfo_Output output; |
| @@ -1115,14 +1119,14 @@ bool ChromeContentRendererClient::AllowBrowserPlugin( |
| return true; |
| // 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; |
| @@ -1130,7 +1134,9 @@ bool ChromeContentRendererClient::AllowBrowserPlugin( |
| return false; |
| return container->element().shadowHost().tagName().equals( |
| - WebString::fromUTF8(kWebViewTagName)); |
| + WebString::fromUTF8(kWebViewTagName)) || |
|
darin (slow to review)
2013/03/19 20:20:03
nit: save tagName() to a local variable.
rpaquay
2013/03/19 20:45:29
Done.
|
| + container->element().shadowHost().tagName().equals( |
| + WebString::fromUTF8(kAdViewTagName)); |
| } |
| } // namespace chrome |