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( |