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 674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 source_map_.RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); | 685 source_map_.RegisterSource("tabs", IDR_TABS_CUSTOM_BINDINGS_JS); |
686 source_map_.RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS); | 686 source_map_.RegisterSource("tts", IDR_TTS_CUSTOM_BINDINGS_JS); |
687 source_map_.RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); | 687 source_map_.RegisterSource("ttsEngine", IDR_TTS_ENGINE_CUSTOM_BINDINGS_JS); |
688 source_map_.RegisterSource("types", IDR_TYPES_CUSTOM_BINDINGS_JS); | 688 source_map_.RegisterSource("types", IDR_TYPES_CUSTOM_BINDINGS_JS); |
689 source_map_.RegisterSource("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS); | 689 source_map_.RegisterSource("webRequest", IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS); |
690 source_map_.RegisterSource("webRequestInternal", | 690 source_map_.RegisterSource("webRequestInternal", |
691 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); | 691 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS); |
692 source_map_.RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); | 692 source_map_.RegisterSource("webstore", IDR_WEBSTORE_CUSTOM_BINDINGS_JS); |
693 | 693 |
694 // Platform app sources that are not API-specific.. | 694 // Platform app sources that are not API-specific.. |
695 source_map_.RegisterSource("browserTag", IDR_BROWSER_TAG_JS); | 695 const CommandLine& command_line = *(CommandLine::ForCurrentProcess()); |
| 696 if (command_line.HasSwitch(switches::kEnableBrowserPluginOldImplementation)) |
| 697 source_map_.RegisterSource("browserTag", IDR_BROWSER_TAG_OLD_JS); |
| 698 else |
| 699 source_map_.RegisterSource("browserTag", IDR_BROWSER_TAG_JS); |
696 source_map_.RegisterSource("platformApp", IDR_PLATFORM_APP_JS); | 700 source_map_.RegisterSource("platformApp", IDR_PLATFORM_APP_JS); |
697 source_map_.RegisterSource("injectAppTitlebar", IDR_INJECT_APP_TITLEBAR_JS); | 701 source_map_.RegisterSource("injectAppTitlebar", IDR_INJECT_APP_TITLEBAR_JS); |
698 } | 702 } |
699 | 703 |
700 void Dispatcher::PopulateLazyBindingsMap() { | 704 void Dispatcher::PopulateLazyBindingsMap() { |
701 lazy_bindings_map_["app"] = InstallAppBindings; | 705 lazy_bindings_map_["app"] = InstallAppBindings; |
702 lazy_bindings_map_["webstore"] = InstallWebstoreBindings; | 706 lazy_bindings_map_["webstore"] = InstallWebstoreBindings; |
703 } | 707 } |
704 | 708 |
705 void Dispatcher::InstallBindings(ModuleSystem* module_system, | 709 void Dispatcher::InstallBindings(ModuleSystem* module_system, |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 // we should abort. | 1120 // we should abort. |
1117 WebKit::WebFrame* frame = context->web_frame(); | 1121 WebKit::WebFrame* frame = context->web_frame(); |
1118 ExtensionURLInfo url_info(frame->document().securityOrigin(), | 1122 ExtensionURLInfo url_info(frame->document().securityOrigin(), |
1119 UserScriptSlave::GetDataSourceURLForFrame(frame)); | 1123 UserScriptSlave::GetDataSourceURLForFrame(frame)); |
1120 CHECK(!extensions_.IsSandboxedPage(url_info)); | 1124 CHECK(!extensions_.IsSandboxedPage(url_info)); |
1121 | 1125 |
1122 return true; | 1126 return true; |
1123 } | 1127 } |
1124 | 1128 |
1125 } // namespace extensions | 1129 } // namespace extensions |
OLD | NEW |