Index: chrome/renderer/extensions/dispatcher.cc |
diff --git a/chrome/renderer/extensions/dispatcher.cc b/chrome/renderer/extensions/dispatcher.cc |
index 19c4488e6494a2a991a3982a665c19b697ee950e..25c3c9babd1257471b2d25e912481f5813baaad4 100644 |
--- a/chrome/renderer/extensions/dispatcher.cc |
+++ b/chrome/renderer/extensions/dispatcher.cc |
@@ -844,6 +844,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); |
} |
@@ -988,6 +994,20 @@ void Dispatcher::DidCreateScriptContext( |
} |
} |
+ if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { |
Fady Samuel
2013/03/18 18:48:05
https://codereview.chromium.org/12496015/patch/300
|
+ 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( |