Index: chrome/renderer/extensions/extension_dispatcher.cc |
diff --git a/chrome/renderer/extensions/extension_dispatcher.cc b/chrome/renderer/extensions/extension_dispatcher.cc |
index 9a60e069f5933b61620d3ee0dd3f41fc9869f5a0..bb45601e40a3c929a9037e5b5cb7cabfb635d36c 100644 |
--- a/chrome/renderer/extensions/extension_dispatcher.cc |
+++ b/chrome/renderer/extensions/extension_dispatcher.cc |
@@ -596,7 +596,6 @@ void ExtensionDispatcher::PopulateSourceMap() { |
source_map_.RegisterSource("pageAction", IDR_PAGE_ACTION_CUSTOM_BINDINGS_JS); |
source_map_.RegisterSource("pageCapture", |
IDR_PAGE_CAPTURE_CUSTOM_BINDINGS_JS); |
- source_map_.RegisterSource("platformApp", IDR_PLATFORM_APP_JS); |
source_map_.RegisterSource("runtime", IDR_RUNTIME_CUSTOM_BINDINGS_JS); |
source_map_.RegisterSource("storage", IDR_STORAGE_CUSTOM_BINDINGS_JS); |
source_map_.RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); |
@@ -607,6 +606,10 @@ void ExtensionDispatcher::PopulateSourceMap() { |
source_map_.RegisterSource("webRequestInternal", |
IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); |
source_map_.RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); |
+ |
+ // Platform app sources that are not API-specific.. |
+ source_map_.RegisterSource("browserTag", IDR_BROWSER_TAG_JS); |
+ source_map_.RegisterSource("platformApp", IDR_PLATFORM_APP_JS); |
} |
void ExtensionDispatcher::PopulateLazyBindingsMap() { |
@@ -720,11 +723,17 @@ void ExtensionDispatcher::DidCreateScriptContext( |
} |
} |
- // Inject custom JS into the platform app context to block certain features |
- // of the document and window. |
- if (IsWithinPlatformApp(frame)) |
+ if (IsWithinPlatformApp(frame)) { |
+ // Inject custom JS into the platform app context to block certain features |
+ // of the document and window. |
module_system->Require("platformApp"); |
+ if (extension && |
+ extension->HasAPIPermission(ExtensionAPIPermission::kBrowserTag)) { |
+ module_system->Require("browserTag"); |
+ } |
+ } |
+ |
context->set_module_system(module_system.Pass()); |
int manifest_version = 1; |