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

Unified Diff: chrome/renderer/extensions/dispatcher.cc

Issue 12463015: Enable <adview> tag for packaged apps. (Closed) Base URL: https://git.chromium.org/chromium/src.git@master
Patch Set: Merge fix. 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/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/resources/extensions/ad_view.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/renderer/extensions/dispatcher.cc
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc
index e6c06a64272d60b68b2d4350b0ea72f8d2ac82ff..ea89657ebe485e0e5c466c5f0645db8423e14fc5 100644
--- a/chrome/renderer/extensions/dispatcher.cc
+++ b/chrome/renderer/extensions/dispatcher.cc
@@ -849,6 +849,12 @@ void Dispatcher::PopulateSourceMap() {
source_map_.RegisterSource("webViewExperimental",
IDR_WEB_VIEW_EXPERIMENTAL_JS);
source_map_.RegisterSource("denyWebView", IDR_WEB_VIEW_DENY_JS);
+ source_map_.RegisterSource("adView", IDR_AD_VIEW_JS);
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableAdviewSrcAttribute)) {
+ source_map_.RegisterSource("adViewCustom", IDR_AD_VIEW_CUSTOM_JS);
+ }
+ source_map_.RegisterSource("denyAdView", IDR_AD_VIEW_DENY_JS);
source_map_.RegisterSource("platformApp", IDR_PLATFORM_APP_JS);
source_map_.RegisterSource("injectAppTitlebar", IDR_INJECT_APP_TITLEBAR_JS);
}
@@ -998,6 +1004,22 @@ void Dispatcher::DidCreateScriptContext(
}
}
+ // Same comment as above for <adview> tag.
+ if (context_type == Feature::BLESSED_EXTENSION_CONTEXT &&
+ is_within_platform_app) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAdview)) {
+ if (extension->HasAPIPermission(APIPermission::kAdView)) {
+ if (CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableAdviewSrcAttribute)) {
+ module_system->Require("adViewCustom");
+ }
+ module_system->Require("adView");
+ } else {
+ module_system->Require("denyAdView");
+ }
+ }
+ }
+
context->set_module_system(module_system.Pass());
context->DispatchOnLoadEvent(
« no previous file with comments | « chrome/renderer/chrome_content_renderer_client.cc ('k') | chrome/renderer/resources/extensions/ad_view.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698