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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/callback.h" | 8 #include "base/callback.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/debug/alias.h" | 10 #include "base/debug/alias.h" |
(...skipping 316 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
327 if (context->GetAvailability("appViewEmbedderInternal").is_available()) { | 327 if (context->GetAvailability("appViewEmbedderInternal").is_available()) { |
328 module_system->Require("appView"); | 328 module_system->Require("appView"); |
329 } else if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) { | 329 } else if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) { |
330 module_system->Require("denyAppView"); | 330 module_system->Require("denyAppView"); |
331 } | 331 } |
332 | 332 |
333 // Note: setting up the WebView class here, not the chrome.webview API. | 333 // Note: setting up the WebView class here, not the chrome.webview API. |
334 // The API will be automatically set up when first used. | 334 // The API will be automatically set up when first used. |
335 if (context->GetAvailability("webViewInternal").is_available()) { | 335 if (context->GetAvailability("webViewInternal").is_available()) { |
336 module_system->Require("webView"); | 336 module_system->Require("webView"); |
| 337 module_system->Require("webViewConstants"); |
337 if (context->GetAvailability("webViewExperimentalInternal") | 338 if (context->GetAvailability("webViewExperimentalInternal") |
338 .is_available()) { | 339 .is_available()) { |
339 module_system->Require("webViewExperimental"); | 340 module_system->Require("webViewExperimental"); |
340 } | 341 } |
341 } else if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) { | 342 } else if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) { |
342 module_system->Require("denyWebView"); | 343 module_system->Require("denyWebView"); |
343 } | 344 } |
344 | 345 |
345 delegate_->RequireAdditionalModules(context, is_within_platform_app); | 346 delegate_->RequireAdditionalModules(context, is_within_platform_app); |
346 | 347 |
(...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
541 resources.push_back(std::make_pair("unload_event", IDR_UNLOAD_EVENT_JS)); | 542 resources.push_back(std::make_pair("unload_event", IDR_UNLOAD_EVENT_JS)); |
542 resources.push_back(std::make_pair("utils", IDR_UTILS_JS)); | 543 resources.push_back(std::make_pair("utils", IDR_UTILS_JS)); |
543 resources.push_back(std::make_pair("webRequest", | 544 resources.push_back(std::make_pair("webRequest", |
544 IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS)); | 545 IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS)); |
545 resources.push_back( | 546 resources.push_back( |
546 std::make_pair("webRequestInternal", | 547 std::make_pair("webRequestInternal", |
547 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS)); | 548 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS)); |
548 // Note: webView not webview so that this doesn't interfere with the | 549 // Note: webView not webview so that this doesn't interfere with the |
549 // chrome.webview API bindings. | 550 // chrome.webview API bindings. |
550 resources.push_back(std::make_pair("webView", IDR_WEB_VIEW_JS)); | 551 resources.push_back(std::make_pair("webView", IDR_WEB_VIEW_JS)); |
| 552 resources.push_back(std::make_pair("webViewConstants", |
| 553 IDR_WEB_VIEW_CONSTANTS_JS)); |
551 resources.push_back(std::make_pair("webViewEvents", IDR_WEB_VIEW_EVENTS_JS)); | 554 resources.push_back(std::make_pair("webViewEvents", IDR_WEB_VIEW_EVENTS_JS)); |
552 resources.push_back( | 555 resources.push_back( |
553 std::make_pair("webViewExperimental", IDR_WEB_VIEW_EXPERIMENTAL_JS)); | 556 std::make_pair("webViewExperimental", IDR_WEB_VIEW_EXPERIMENTAL_JS)); |
554 resources.push_back(std::make_pair("webViewInternal", | 557 resources.push_back(std::make_pair("webViewInternal", |
555 IDR_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS)); | 558 IDR_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS)); |
556 resources.push_back(std::make_pair("denyWebView", IDR_WEB_VIEW_DENY_JS)); | 559 resources.push_back(std::make_pair("denyWebView", IDR_WEB_VIEW_DENY_JS)); |
557 resources.push_back( | 560 resources.push_back( |
558 std::make_pair(mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS)); | 561 std::make_pair(mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS)); |
559 resources.push_back( | 562 resources.push_back( |
560 std::make_pair(mojo::kCodecModuleName, IDR_MOJO_CODEC_JS)); | 563 std::make_pair(mojo::kCodecModuleName, IDR_MOJO_CODEC_JS)); |
(...skipping 823 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1384 return v8::Handle<v8::Object>(); | 1387 return v8::Handle<v8::Object>(); |
1385 | 1388 |
1386 if (bind_name) | 1389 if (bind_name) |
1387 *bind_name = split.back(); | 1390 *bind_name = split.back(); |
1388 | 1391 |
1389 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) | 1392 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) |
1390 : bind_object; | 1393 : bind_object; |
1391 } | 1394 } |
1392 | 1395 |
1393 } // namespace extensions | 1396 } // namespace extensions |
OLD | NEW |