| 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 653 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 664 source_map_.RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); | 664 source_map_.RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); |
| 665 source_map_.RegisterSource("types", IDR_TYPES_CUSTOM_BINDINGS_JS); | 665 source_map_.RegisterSource("types", IDR_TYPES_CUSTOM_BINDINGS_JS); |
| 666 source_map_.RegisterSource("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS); | 666 source_map_.RegisterSource("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS); |
| 667 source_map_.RegisterSource("webRequestInternal", | 667 source_map_.RegisterSource("webRequestInternal", |
| 668 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); | 668 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); |
| 669 source_map_.RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); | 669 source_map_.RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); |
| 670 | 670 |
| 671 // Platform app sources that are not API-specific.. | 671 // Platform app sources that are not API-specific.. |
| 672 source_map_.RegisterSource("browserTag", IDR_BROWSER_TAG_JS); | 672 source_map_.RegisterSource("browserTag", IDR_BROWSER_TAG_JS); |
| 673 source_map_.RegisterSource("platformApp", IDR_PLATFORM_APP_JS); | 673 source_map_.RegisterSource("platformApp", IDR_PLATFORM_APP_JS); |
| 674 source_map_.RegisterSource("injectAppTitlebar", IDR_INJECT_APP_TITLEBAR_JS); |
| 674 } | 675 } |
| 675 | 676 |
| 676 void Dispatcher::PopulateLazyBindingsMap() { | 677 void Dispatcher::PopulateLazyBindingsMap() { |
| 677 lazy_bindings_map_["app"] = InstallAppBindings; | 678 lazy_bindings_map_["app"] = InstallAppBindings; |
| 678 lazy_bindings_map_["webstore"] = InstallWebstoreBindings; | 679 lazy_bindings_map_["webstore"] = InstallWebstoreBindings; |
| 679 } | 680 } |
| 680 | 681 |
| 681 void Dispatcher::InstallBindings(ModuleSystem* module_system, | 682 void Dispatcher::InstallBindings(ModuleSystem* module_system, |
| 682 v8::Handle<v8::Context> v8_context, | 683 v8::Handle<v8::Context> v8_context, |
| 683 const std::string& api) { | 684 const std::string& api) { |
| (...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1092 // we should abort. | 1093 // we should abort. |
| 1093 WebKit::WebFrame* frame = context->web_frame(); | 1094 WebKit::WebFrame* frame = context->web_frame(); |
| 1094 ExtensionURLInfo url_info(frame->document().securityOrigin(), | 1095 ExtensionURLInfo url_info(frame->document().securityOrigin(), |
| 1095 UserScriptSlave::GetDataSourceURLForFrame(frame)); | 1096 UserScriptSlave::GetDataSourceURLForFrame(frame)); |
| 1096 CHECK(!extensions_.IsSandboxedPage(url_info)); | 1097 CHECK(!extensions_.IsSandboxedPage(url_info)); |
| 1097 | 1098 |
| 1098 return true; | 1099 return true; |
| 1099 } | 1100 } |
| 1100 | 1101 |
| 1101 } // namespace extensions | 1102 } // namespace extensions |
| OLD | NEW |