| 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 317 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 module_system->Require("webViewConstants"); |
| 338 module_system->Require("webViewAttributes"); |
| 338 if (context->GetAvailability("webViewExperimentalInternal") | 339 if (context->GetAvailability("webViewExperimentalInternal") |
| 339 .is_available()) { | 340 .is_available()) { |
| 340 module_system->Require("webViewExperimental"); | 341 module_system->Require("webViewExperimental"); |
| 341 } | 342 } |
| 342 } else if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) { | 343 } else if (context_type == extensions::Feature::BLESSED_EXTENSION_CONTEXT) { |
| 343 module_system->Require("denyWebView"); | 344 module_system->Require("denyWebView"); |
| 344 } | 345 } |
| 345 | 346 |
| 346 delegate_->RequireAdditionalModules(context, is_within_platform_app); | 347 delegate_->RequireAdditionalModules(context, is_within_platform_app); |
| 347 | 348 |
| (...skipping 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 resources.push_back(std::make_pair("unload_event", IDR_UNLOAD_EVENT_JS)); | 543 resources.push_back(std::make_pair("unload_event", IDR_UNLOAD_EVENT_JS)); |
| 543 resources.push_back(std::make_pair("utils", IDR_UTILS_JS)); | 544 resources.push_back(std::make_pair("utils", IDR_UTILS_JS)); |
| 544 resources.push_back(std::make_pair("webRequest", | 545 resources.push_back(std::make_pair("webRequest", |
| 545 IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS)); | 546 IDR_WEB_REQUEST_CUSTOM_BINDINGS_JS)); |
| 546 resources.push_back( | 547 resources.push_back( |
| 547 std::make_pair("webRequestInternal", | 548 std::make_pair("webRequestInternal", |
| 548 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS)); | 549 IDR_WEB_REQUEST_INTERNAL_CUSTOM_BINDINGS_JS)); |
| 549 // Note: webView not webview so that this doesn't interfere with the | 550 // Note: webView not webview so that this doesn't interfere with the |
| 550 // chrome.webview API bindings. | 551 // chrome.webview API bindings. |
| 551 resources.push_back(std::make_pair("webView", IDR_WEB_VIEW_JS)); | 552 resources.push_back(std::make_pair("webView", IDR_WEB_VIEW_JS)); |
| 553 resources.push_back(std::make_pair("webViewAttributes", |
| 554 IDR_WEB_VIEW_ATTRIBUTES_JS)); |
| 552 resources.push_back(std::make_pair("webViewConstants", | 555 resources.push_back(std::make_pair("webViewConstants", |
| 553 IDR_WEB_VIEW_CONSTANTS_JS)); | 556 IDR_WEB_VIEW_CONSTANTS_JS)); |
| 554 resources.push_back(std::make_pair("webViewEvents", IDR_WEB_VIEW_EVENTS_JS)); | 557 resources.push_back(std::make_pair("webViewEvents", IDR_WEB_VIEW_EVENTS_JS)); |
| 555 resources.push_back( | 558 resources.push_back( |
| 556 std::make_pair("webViewExperimental", IDR_WEB_VIEW_EXPERIMENTAL_JS)); | 559 std::make_pair("webViewExperimental", IDR_WEB_VIEW_EXPERIMENTAL_JS)); |
| 557 resources.push_back(std::make_pair("webViewInternal", | 560 resources.push_back(std::make_pair("webViewInternal", |
| 558 IDR_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS)); | 561 IDR_WEB_VIEW_INTERNAL_CUSTOM_BINDINGS_JS)); |
| 559 resources.push_back(std::make_pair("denyWebView", IDR_WEB_VIEW_DENY_JS)); | 562 resources.push_back(std::make_pair("denyWebView", IDR_WEB_VIEW_DENY_JS)); |
| 560 resources.push_back( | 563 resources.push_back( |
| 561 std::make_pair(mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS)); | 564 std::make_pair(mojo::kBufferModuleName, IDR_MOJO_BUFFER_JS)); |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1387 return v8::Handle<v8::Object>(); | 1390 return v8::Handle<v8::Object>(); |
| 1388 | 1391 |
| 1389 if (bind_name) | 1392 if (bind_name) |
| 1390 *bind_name = split.back(); | 1393 *bind_name = split.back(); |
| 1391 | 1394 |
| 1392 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) | 1395 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) |
| 1393 : bind_object; | 1396 : bind_object; |
| 1394 } | 1397 } |
| 1395 | 1398 |
| 1396 } // namespace extensions | 1399 } // namespace extensions |
| OLD | NEW |