| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/renderer/extensions/dispatcher.h" | 5 #include "chrome/renderer/extensions/dispatcher.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
| 9 #include "base/memory/scoped_ptr.h" | 9 #include "base/memory/scoped_ptr.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| (...skipping 650 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 661 source_map_.RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); | 661 source_map_.RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); |
| 662 source_map_.RegisterSource("types", IDR_TYPES_CUSTOM_BINDINGS_JS); | 662 source_map_.RegisterSource("types", IDR_TYPES_CUSTOM_BINDINGS_JS); |
| 663 source_map_.RegisterSource("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS); | 663 source_map_.RegisterSource("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS); |
| 664 source_map_.RegisterSource("webRequestInternal", | 664 source_map_.RegisterSource("webRequestInternal", |
| 665 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); | 665 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); |
| 666 source_map_.RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); | 666 source_map_.RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); |
| 667 | 667 |
| 668 // Platform app sources that are not API-specific.. | 668 // Platform app sources that are not API-specific.. |
| 669 source_map_.RegisterSource("browserTag", IDR_BROWSER_TAG_JS); | 669 source_map_.RegisterSource("browserTag", IDR_BROWSER_TAG_JS); |
| 670 source_map_.RegisterSource("platformApp", IDR_PLATFORM_APP_JS); | 670 source_map_.RegisterSource("platformApp", IDR_PLATFORM_APP_JS); |
| 671 source_map_.RegisterSource("injectAppTitlebar", IDR_INJECT_APP_TITLEBAR_JS); |
| 671 } | 672 } |
| 672 | 673 |
| 673 void Dispatcher::PopulateLazyBindingsMap() { | 674 void Dispatcher::PopulateLazyBindingsMap() { |
| 674 lazy_bindings_map_["app"] = InstallAppBindings; | 675 lazy_bindings_map_["app"] = InstallAppBindings; |
| 675 lazy_bindings_map_["webstore"] = InstallWebstoreBindings; | 676 lazy_bindings_map_["webstore"] = InstallWebstoreBindings; |
| 676 } | 677 } |
| 677 | 678 |
| 678 void Dispatcher::InstallBindings(ModuleSystem* module_system, | 679 void Dispatcher::InstallBindings(ModuleSystem* module_system, |
| 679 v8::Handle<v8::Context> v8_context, | 680 v8::Handle<v8::Context> v8_context, |
| 680 const std::string& api) { | 681 const std::string& api) { |
| (...skipping 420 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 // we should abort. | 1102 // we should abort. |
| 1102 WebKit::WebFrame* frame = context->web_frame(); | 1103 WebKit::WebFrame* frame = context->web_frame(); |
| 1103 ExtensionURLInfo url_info(frame->document().securityOrigin(), | 1104 ExtensionURLInfo url_info(frame->document().securityOrigin(), |
| 1104 UserScriptSlave::GetDataSourceURLForFrame(frame)); | 1105 UserScriptSlave::GetDataSourceURLForFrame(frame)); |
| 1105 CHECK(!extensions_.IsSandboxedPage(url_info)); | 1106 CHECK(!extensions_.IsSandboxedPage(url_info)); |
| 1106 | 1107 |
| 1107 return true; | 1108 return true; |
| 1108 } | 1109 } |
| 1109 | 1110 |
| 1110 } // namespace extensions | 1111 } // namespace extensions |
| OLD | NEW |