Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5168)

Unified Diff: chrome/renderer/chrome_content_renderer_client.cc

Issue 12463015: Enable <adview> tag for packaged apps. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Rebasing. Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/common/extensions/permissions/api_permission.cc ('k') | chrome/renderer/extensions/dispatcher.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
« no previous file with comments | « chrome/common/extensions/permissions/api_permission.cc ('k') | chrome/renderer/extensions/dispatcher.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698