OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 #import "ios/web/webui/crw_web_ui_manager.h" | 5 #import "ios/web/webui/crw_web_ui_manager.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/json/string_escape.h" | 10 #include "base/json/string_escape.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 // Look for built-in scripts first. | 219 // Look for built-in scripts first. |
220 std::map<std::string, int> resource_map{ | 220 std::map<std::string, int> resource_map{ |
221 {mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS}, | 221 {mojo::kBindingsModuleName, IDR_MOJO_BINDINGS_JS}, |
222 {mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS}, | 222 {mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS}, |
223 {mojo::kCodecModuleName, IDR_MOJO_CODEC_JS}, | 223 {mojo::kCodecModuleName, IDR_MOJO_CODEC_JS}, |
224 {mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS}, | 224 {mojo::kConnectorModuleName, IDR_MOJO_CONNECTOR_JS}, |
225 {mojo::kInterfaceTypesModuleName, IDR_MOJO_INTERFACE_TYPES_JS}, | 225 {mojo::kInterfaceTypesModuleName, IDR_MOJO_INTERFACE_TYPES_JS}, |
226 {mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS}, | 226 {mojo::kRouterModuleName, IDR_MOJO_ROUTER_JS}, |
227 {mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS}, | 227 {mojo::kUnicodeModuleName, IDR_MOJO_UNICODE_JS}, |
228 {mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS}, | 228 {mojo::kValidatorModuleName, IDR_MOJO_VALIDATOR_JS}, |
| 229 {web::kConsoleModuleName, IDR_IOS_CONSOLE_JS}, |
229 {web::kSyncMessageChannelModuleName, | 230 {web::kSyncMessageChannelModuleName, |
230 IDR_IOS_MOJO_SYNC_MESSAGE_CHANNEL_JS}, | 231 IDR_IOS_MOJO_SYNC_MESSAGE_CHANNEL_JS}, |
231 {web::kHandleUtilModuleName, IDR_IOS_MOJO_HANDLE_UTIL_JS}, | 232 {web::kHandleUtilModuleName, IDR_IOS_MOJO_HANDLE_UTIL_JS}, |
232 {web::kSupportModuleName, IDR_IOS_MOJO_SUPPORT_JS}, | 233 {web::kSupportModuleName, IDR_IOS_MOJO_SUPPORT_JS}, |
233 {web::kCoreModuleName, IDR_IOS_MOJO_CORE_JS}, | 234 {web::kCoreModuleName, IDR_IOS_MOJO_CORE_JS}, |
234 {web::kInterfaceProviderModuleName, IDR_IOS_SHELL_INTERFACE_PROVIDER_JS}, | 235 {web::kInterfaceProviderModuleName, IDR_IOS_SHELL_INTERFACE_PROVIDER_JS}, |
235 }; | 236 }; |
236 scoped_refptr<base::RefCountedMemory> scriptData( | 237 scoped_refptr<base::RefCountedMemory> scriptData( |
237 web::GetWebClient()->GetDataResourceBytes(resource_map[moduleName])); | 238 web::GetWebClient()->GetDataResourceBytes(resource_map[moduleName])); |
238 if (scriptData) { | 239 if (scriptData) { |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 #pragma mark - Testing-Only Methods | 307 #pragma mark - Testing-Only Methods |
307 | 308 |
308 - (std::unique_ptr<web::URLFetcherBlockAdapter>) | 309 - (std::unique_ptr<web::URLFetcherBlockAdapter>) |
309 fetcherForURL:(const GURL&)URL | 310 fetcherForURL:(const GURL&)URL |
310 completionHandler:(web::URLFetcherBlockAdapterCompletion)handler { | 311 completionHandler:(web::URLFetcherBlockAdapterCompletion)handler { |
311 return base::MakeUnique<web::URLFetcherBlockAdapter>( | 312 return base::MakeUnique<web::URLFetcherBlockAdapter>( |
312 URL, _webState->GetBrowserState()->GetRequestContext(), handler); | 313 URL, _webState->GetBrowserState()->GetRequestContext(), handler); |
313 } | 314 } |
314 | 315 |
315 @end | 316 @end |
OLD | NEW |