OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "extensions/renderer/dispatcher.h" | 5 #include "extensions/renderer/dispatcher.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 23 matching lines...) Expand all Loading... |
34 #include "content/public/renderer/render_frame.h" | 34 #include "content/public/renderer/render_frame.h" |
35 #include "content/public/renderer/render_thread.h" | 35 #include "content/public/renderer/render_thread.h" |
36 #include "extensions/common/api/messaging/message.h" | 36 #include "extensions/common/api/messaging/message.h" |
37 #include "extensions/common/constants.h" | 37 #include "extensions/common/constants.h" |
38 #include "extensions/common/extension_api.h" | 38 #include "extensions/common/extension_api.h" |
39 #include "extensions/common/extension_messages.h" | 39 #include "extensions/common/extension_messages.h" |
40 #include "extensions/common/extension_urls.h" | 40 #include "extensions/common/extension_urls.h" |
41 #include "extensions/common/feature_switch.h" | 41 #include "extensions/common/feature_switch.h" |
42 #include "extensions/common/features/behavior_feature.h" | 42 #include "extensions/common/features/behavior_feature.h" |
43 #include "extensions/common/features/feature.h" | 43 #include "extensions/common/features/feature.h" |
| 44 #include "extensions/common/features/feature_channel.h" |
44 #include "extensions/common/features/feature_provider.h" | 45 #include "extensions/common/features/feature_provider.h" |
45 #include "extensions/common/features/feature_util.h" | 46 #include "extensions/common/features/feature_util.h" |
46 #include "extensions/common/manifest.h" | 47 #include "extensions/common/manifest.h" |
47 #include "extensions/common/manifest_constants.h" | 48 #include "extensions/common/manifest_constants.h" |
48 #include "extensions/common/manifest_handlers/background_info.h" | 49 #include "extensions/common/manifest_handlers/background_info.h" |
49 #include "extensions/common/manifest_handlers/content_capabilities_handler.h" | 50 #include "extensions/common/manifest_handlers/content_capabilities_handler.h" |
50 #include "extensions/common/manifest_handlers/externally_connectable.h" | 51 #include "extensions/common/manifest_handlers/externally_connectable.h" |
51 #include "extensions/common/manifest_handlers/options_page_info.h" | 52 #include "extensions/common/manifest_handlers/options_page_info.h" |
52 #include "extensions/common/message_bundle.h" | 53 #include "extensions/common/message_bundle.h" |
53 #include "extensions/common/permissions/permission_set.h" | 54 #include "extensions/common/permissions/permission_set.h" |
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1103 | 1104 |
1104 void Dispatcher::OnMessageInvoke(const std::string& extension_id, | 1105 void Dispatcher::OnMessageInvoke(const std::string& extension_id, |
1105 const std::string& module_name, | 1106 const std::string& module_name, |
1106 const std::string& function_name, | 1107 const std::string& function_name, |
1107 const base::ListValue& args, | 1108 const base::ListValue& args, |
1108 bool user_gesture) { | 1109 bool user_gesture) { |
1109 InvokeModuleSystemMethod( | 1110 InvokeModuleSystemMethod( |
1110 NULL, extension_id, module_name, function_name, args, user_gesture); | 1111 NULL, extension_id, module_name, function_name, args, user_gesture); |
1111 } | 1112 } |
1112 | 1113 |
1113 void Dispatcher::OnSetChannel(int channel) { | 1114 void Dispatcher::OnSetChannel(version_info::Channel channel) { |
1114 delegate_->SetChannel(channel); | 1115 SetCurrentChannel(channel); |
| 1116 if (feature_util::ExtensionServiceWorkersEnabled()) { |
| 1117 // chrome-extension: resources should be allowed to register ServiceWorkers. |
| 1118 blink::WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers( |
| 1119 blink::WebString::fromUTF8(extensions::kExtensionScheme)); |
| 1120 } |
1115 } | 1121 } |
1116 | 1122 |
1117 void Dispatcher::OnSetScriptingWhitelist( | 1123 void Dispatcher::OnSetScriptingWhitelist( |
1118 const ExtensionsClient::ScriptingWhitelist& extension_ids) { | 1124 const ExtensionsClient::ScriptingWhitelist& extension_ids) { |
1119 ExtensionsClient::Get()->SetScriptingWhitelist(extension_ids); | 1125 ExtensionsClient::Get()->SetScriptingWhitelist(extension_ids); |
1120 } | 1126 } |
1121 | 1127 |
1122 void Dispatcher::OnSetSystemFont(const std::string& font_family, | 1128 void Dispatcher::OnSetSystemFont(const std::string& font_family, |
1123 const std::string& font_size) { | 1129 const std::string& font_size) { |
1124 system_font_family_ = font_family; | 1130 system_font_family_ = font_family; |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1660 // The "guestViewDeny" module must always be loaded last. It registers | 1666 // The "guestViewDeny" module must always be loaded last. It registers |
1661 // error-providing custom elements for the GuestView types that are not | 1667 // error-providing custom elements for the GuestView types that are not |
1662 // available, and thus all of those types must have been checked and loaded | 1668 // available, and thus all of those types must have been checked and loaded |
1663 // (or not loaded) beforehand. | 1669 // (or not loaded) beforehand. |
1664 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { | 1670 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { |
1665 module_system->Require("guestViewDeny"); | 1671 module_system->Require("guestViewDeny"); |
1666 } | 1672 } |
1667 } | 1673 } |
1668 | 1674 |
1669 } // namespace extensions | 1675 } // namespace extensions |
OLD | NEW |