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 22 matching lines...) Expand all Loading... |
33 #include "extensions/common/permissions/permission_set.h" | 33 #include "extensions/common/permissions/permission_set.h" |
34 #include "extensions/common/permissions/permissions_data.h" | 34 #include "extensions/common/permissions/permissions_data.h" |
35 #include "extensions/common/switches.h" | 35 #include "extensions/common/switches.h" |
36 #include "extensions/renderer/css_native_handler.h" | 36 #include "extensions/renderer/css_native_handler.h" |
37 #include "extensions/renderer/dispatcher.h" | 37 #include "extensions/renderer/dispatcher.h" |
38 #include "extensions/renderer/i18n_custom_bindings.h" | 38 #include "extensions/renderer/i18n_custom_bindings.h" |
39 #include "extensions/renderer/lazy_background_page_native_handler.h" | 39 #include "extensions/renderer/lazy_background_page_native_handler.h" |
40 #include "extensions/renderer/native_handler.h" | 40 #include "extensions/renderer/native_handler.h" |
41 #include "extensions/renderer/resource_bundle_source_map.h" | 41 #include "extensions/renderer/resource_bundle_source_map.h" |
42 #include "extensions/renderer/script_context.h" | 42 #include "extensions/renderer/script_context.h" |
| 43 #include "media/media_features.h" |
43 #include "third_party/WebKit/public/platform/WebString.h" | 44 #include "third_party/WebKit/public/platform/WebString.h" |
44 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" | 45 #include "third_party/WebKit/public/web/WebSecurityPolicy.h" |
45 | 46 |
46 #if defined(ENABLE_WEBRTC) | 47 #if BUILDFLAG(ENABLE_WEBRTC) |
47 #include "chrome/renderer/extensions/cast_streaming_native_handler.h" | 48 #include "chrome/renderer/extensions/cast_streaming_native_handler.h" |
48 #endif | 49 #endif |
49 | 50 |
50 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
51 #include "chrome/renderer/extensions/file_browser_handler_custom_bindings.h" | 52 #include "chrome/renderer/extensions/file_browser_handler_custom_bindings.h" |
52 #include "chrome/renderer/extensions/file_manager_private_custom_bindings.h" | 53 #include "chrome/renderer/extensions/file_manager_private_custom_bindings.h" |
53 #include "chrome/renderer/extensions/platform_keys_natives.h" | 54 #include "chrome/renderer/extensions/platform_keys_natives.h" |
54 #endif | 55 #endif |
55 | 56 |
56 using extensions::NativeHandler; | 57 using extensions::NativeHandler; |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 module_system->RegisterNativeHandler( | 125 module_system->RegisterNativeHandler( |
125 "mediaGalleries", | 126 "mediaGalleries", |
126 std::unique_ptr<NativeHandler>( | 127 std::unique_ptr<NativeHandler>( |
127 new extensions::MediaGalleriesCustomBindings(context))); | 128 new extensions::MediaGalleriesCustomBindings(context))); |
128 module_system->RegisterNativeHandler( | 129 module_system->RegisterNativeHandler( |
129 "page_capture", std::unique_ptr<NativeHandler>( | 130 "page_capture", std::unique_ptr<NativeHandler>( |
130 new extensions::PageCaptureCustomBindings(context))); | 131 new extensions::PageCaptureCustomBindings(context))); |
131 module_system->RegisterNativeHandler( | 132 module_system->RegisterNativeHandler( |
132 "webstore", std::unique_ptr<NativeHandler>( | 133 "webstore", std::unique_ptr<NativeHandler>( |
133 new extensions::WebstoreBindings(context))); | 134 new extensions::WebstoreBindings(context))); |
134 #if defined(ENABLE_WEBRTC) | 135 #if BUILDFLAG(ENABLE_WEBRTC) |
135 module_system->RegisterNativeHandler( | 136 module_system->RegisterNativeHandler( |
136 "cast_streaming_natives", | 137 "cast_streaming_natives", |
137 std::unique_ptr<NativeHandler>( | 138 std::unique_ptr<NativeHandler>( |
138 new extensions::CastStreamingNativeHandler(context))); | 139 new extensions::CastStreamingNativeHandler(context))); |
139 #endif | 140 #endif |
140 module_system->RegisterNativeHandler( | 141 module_system->RegisterNativeHandler( |
141 "automationInternal", | 142 "automationInternal", |
142 std::unique_ptr<NativeHandler>( | 143 std::unique_ptr<NativeHandler>( |
143 new extensions::AutomationInternalCustomBindings(context))); | 144 new extensions::AutomationInternalCustomBindings(context))); |
144 | 145 |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
227 source_map->RegisterSource("platformKeys.internalAPI", | 228 source_map->RegisterSource("platformKeys.internalAPI", |
228 IDR_PLATFORM_KEYS_INTERNAL_API_JS); | 229 IDR_PLATFORM_KEYS_INTERNAL_API_JS); |
229 source_map->RegisterSource("platformKeys.Key", IDR_PLATFORM_KEYS_KEY_JS); | 230 source_map->RegisterSource("platformKeys.Key", IDR_PLATFORM_KEYS_KEY_JS); |
230 source_map->RegisterSource("platformKeys.SubtleCrypto", | 231 source_map->RegisterSource("platformKeys.SubtleCrypto", |
231 IDR_PLATFORM_KEYS_SUBTLE_CRYPTO_JS); | 232 IDR_PLATFORM_KEYS_SUBTLE_CRYPTO_JS); |
232 source_map->RegisterSource("platformKeys.utils", IDR_PLATFORM_KEYS_UTILS_JS); | 233 source_map->RegisterSource("platformKeys.utils", IDR_PLATFORM_KEYS_UTILS_JS); |
233 source_map->RegisterSource("terminalPrivate", | 234 source_map->RegisterSource("terminalPrivate", |
234 IDR_TERMINAL_PRIVATE_CUSTOM_BINDINGS_JS); | 235 IDR_TERMINAL_PRIVATE_CUSTOM_BINDINGS_JS); |
235 #endif // defined(OS_CHROMEOS) | 236 #endif // defined(OS_CHROMEOS) |
236 | 237 |
237 #if defined(ENABLE_WEBRTC) | 238 #if BUILDFLAG(ENABLE_WEBRTC) |
238 source_map->RegisterSource("cast.streaming.rtpStream", | 239 source_map->RegisterSource("cast.streaming.rtpStream", |
239 IDR_CAST_STREAMING_RTP_STREAM_CUSTOM_BINDINGS_JS); | 240 IDR_CAST_STREAMING_RTP_STREAM_CUSTOM_BINDINGS_JS); |
240 source_map->RegisterSource("cast.streaming.session", | 241 source_map->RegisterSource("cast.streaming.session", |
241 IDR_CAST_STREAMING_SESSION_CUSTOM_BINDINGS_JS); | 242 IDR_CAST_STREAMING_SESSION_CUSTOM_BINDINGS_JS); |
242 source_map->RegisterSource( | 243 source_map->RegisterSource( |
243 "cast.streaming.udpTransport", | 244 "cast.streaming.udpTransport", |
244 IDR_CAST_STREAMING_UDP_TRANSPORT_CUSTOM_BINDINGS_JS); | 245 IDR_CAST_STREAMING_UDP_TRANSPORT_CUSTOM_BINDINGS_JS); |
245 source_map->RegisterSource( | 246 source_map->RegisterSource( |
246 "cast.streaming.receiverSession", | 247 "cast.streaming.receiverSession", |
247 IDR_CAST_STREAMING_RECEIVER_SESSION_CUSTOM_BINDINGS_JS); | 248 IDR_CAST_STREAMING_RECEIVER_SESSION_CUSTOM_BINDINGS_JS); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
291 } | 292 } |
292 | 293 |
293 void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated( | 294 void ChromeExtensionsDispatcherDelegate::OnActiveExtensionsUpdated( |
294 const std::set<std::string>& extension_ids) { | 295 const std::set<std::string>& extension_ids) { |
295 // In single-process mode, the browser process reports the active extensions. | 296 // In single-process mode, the browser process reports the active extensions. |
296 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 297 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
297 ::switches::kSingleProcess)) | 298 ::switches::kSingleProcess)) |
298 return; | 299 return; |
299 crash_keys::SetActiveExtensions(extension_ids); | 300 crash_keys::SetActiveExtensions(extension_ids); |
300 } | 301 } |
OLD | NEW |