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 "chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.h" | 5 #include "chrome/renderer/extensions/chrome_extensions_dispatcher_delegate.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/sha1.h" | 10 #include "base/sha1.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 "automationInternal", | 126 "automationInternal", |
127 std::unique_ptr<NativeHandler>( | 127 std::unique_ptr<NativeHandler>( |
128 new extensions::AutomationInternalCustomBindings(context))); | 128 new extensions::AutomationInternalCustomBindings(context))); |
129 | 129 |
130 // The following are native handlers that are defined in //extensions, but | 130 // The following are native handlers that are defined in //extensions, but |
131 // are only used for APIs defined in Chrome. | 131 // are only used for APIs defined in Chrome. |
132 // TODO(devlin): We should clean this up. If an API is defined in Chrome, | 132 // TODO(devlin): We should clean this up. If an API is defined in Chrome, |
133 // there's no reason to have its native handlers residing and being compiled | 133 // there's no reason to have its native handlers residing and being compiled |
134 // in //extensions. | 134 // in //extensions. |
135 module_system->RegisterNativeHandler( | 135 module_system->RegisterNativeHandler( |
136 "i18n", | 136 "i18n", std::unique_ptr<NativeHandler>( |
137 scoped_ptr<NativeHandler>(new extensions::I18NCustomBindings(context))); | 137 new extensions::I18NCustomBindings(context))); |
138 module_system->RegisterNativeHandler( | 138 module_system->RegisterNativeHandler( |
139 "lazy_background_page", | 139 "lazy_background_page", |
140 scoped_ptr<NativeHandler>( | 140 std::unique_ptr<NativeHandler>( |
141 new extensions::LazyBackgroundPageNativeHandler(context))); | 141 new extensions::LazyBackgroundPageNativeHandler(context))); |
142 } | 142 } |
143 | 143 |
144 void ChromeExtensionsDispatcherDelegate::PopulateSourceMap( | 144 void ChromeExtensionsDispatcherDelegate::PopulateSourceMap( |
145 extensions::ResourceBundleSourceMap* source_map) { | 145 extensions::ResourceBundleSourceMap* source_map) { |
146 // Custom bindings. | 146 // Custom bindings. |
147 source_map->RegisterSource("app", IDR_APP_CUSTOM_BINDINGS_JS); | 147 source_map->RegisterSource("app", IDR_APP_CUSTOM_BINDINGS_JS); |
148 source_map->RegisterSource("automation", IDR_AUTOMATION_CUSTOM_BINDINGS_JS); | 148 source_map->RegisterSource("automation", IDR_AUTOMATION_CUSTOM_BINDINGS_JS); |
149 source_map->RegisterSource("automationEvent", IDR_AUTOMATION_EVENT_JS); | 149 source_map->RegisterSource("automationEvent", IDR_AUTOMATION_EVENT_JS); |
150 source_map->RegisterSource("automationNode", IDR_AUTOMATION_NODE_JS); | 150 source_map->RegisterSource("automationNode", IDR_AUTOMATION_NODE_JS); |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 } | 278 } |
279 | 279 |
280 void ChromeExtensionsDispatcherDelegate::SetChannel(int channel) { | 280 void ChromeExtensionsDispatcherDelegate::SetChannel(int channel) { |
281 extensions::SetCurrentChannel(static_cast<version_info::Channel>(channel)); | 281 extensions::SetCurrentChannel(static_cast<version_info::Channel>(channel)); |
282 if (extensions::feature_util::ExtensionServiceWorkersEnabled()) { | 282 if (extensions::feature_util::ExtensionServiceWorkersEnabled()) { |
283 // chrome-extension: resources should be allowed to register ServiceWorkers. | 283 // chrome-extension: resources should be allowed to register ServiceWorkers. |
284 blink::WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers( | 284 blink::WebSecurityPolicy::registerURLSchemeAsAllowingServiceWorkers( |
285 blink::WebString::fromUTF8(extensions::kExtensionScheme)); | 285 blink::WebString::fromUTF8(extensions::kExtensionScheme)); |
286 } | 286 } |
287 } | 287 } |
OLD | NEW |