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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/metrics/user_metrics_action.h" | 21 #include "base/metrics/user_metrics_action.h" |
22 #include "base/strings/string_piece.h" | 22 #include "base/strings/string_piece.h" |
23 #include "base/strings/string_split.h" | 23 #include "base/strings/string_split.h" |
24 #include "base/strings/string_util.h" | 24 #include "base/strings/string_util.h" |
25 #include "base/strings/utf_string_conversions.h" | 25 #include "base/strings/utf_string_conversions.h" |
26 #include "base/time/time.h" | 26 #include "base/time/time.h" |
27 #include "base/values.h" | 27 #include "base/values.h" |
28 #include "build/build_config.h" | 28 #include "build/build_config.h" |
29 #include "content/grit/content_resources.h" | 29 #include "content/grit/content_resources.h" |
30 #include "content/public/child/v8_value_converter.h" | 30 #include "content/public/child/v8_value_converter.h" |
31 #include "content/public/common/browser_plugin_guest_mode.h" | |
32 #include "content/public/common/content_switches.h" | 31 #include "content/public/common/content_switches.h" |
33 #include "content/public/common/url_constants.h" | 32 #include "content/public/common/url_constants.h" |
| 33 #include "content/public/renderer/guest_mode.h" |
34 #include "content/public/renderer/render_frame.h" | 34 #include "content/public/renderer/render_frame.h" |
35 #include "content/public/renderer/render_thread.h" | 35 #include "content/public/renderer/render_thread.h" |
36 #include "extensions/common/api/messaging/message.h" | 36 #include "extensions/common/api/messaging/message.h" |
37 #include "extensions/common/constants.h" | 37 #include "extensions/common/constants.h" |
38 #include "extensions/common/extension_api.h" | 38 #include "extensions/common/extension_api.h" |
39 #include "extensions/common/extension_messages.h" | 39 #include "extensions/common/extension_messages.h" |
40 #include "extensions/common/extension_urls.h" | 40 #include "extensions/common/extension_urls.h" |
41 #include "extensions/common/feature_switch.h" | 41 #include "extensions/common/feature_switch.h" |
42 #include "extensions/common/features/behavior_feature.h" | 42 #include "extensions/common/features/behavior_feature.h" |
43 #include "extensions/common/features/feature.h" | 43 #include "extensions/common/features/feature.h" |
(...skipping 659 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
703 "extensionViewInternal", IDR_EXTENSION_VIEW_INTERNAL_CUSTOM_BINDINGS_JS)); | 703 "extensionViewInternal", IDR_EXTENSION_VIEW_INTERNAL_CUSTOM_BINDINGS_JS)); |
704 resources.push_back(std::make_pair("guestView", IDR_GUEST_VIEW_JS)); | 704 resources.push_back(std::make_pair("guestView", IDR_GUEST_VIEW_JS)); |
705 resources.push_back(std::make_pair("guestViewAttributes", | 705 resources.push_back(std::make_pair("guestViewAttributes", |
706 IDR_GUEST_VIEW_ATTRIBUTES_JS)); | 706 IDR_GUEST_VIEW_ATTRIBUTES_JS)); |
707 resources.push_back(std::make_pair("guestViewContainer", | 707 resources.push_back(std::make_pair("guestViewContainer", |
708 IDR_GUEST_VIEW_CONTAINER_JS)); | 708 IDR_GUEST_VIEW_CONTAINER_JS)); |
709 resources.push_back(std::make_pair("guestViewDeny", IDR_GUEST_VIEW_DENY_JS)); | 709 resources.push_back(std::make_pair("guestViewDeny", IDR_GUEST_VIEW_DENY_JS)); |
710 resources.push_back(std::make_pair("guestViewEvents", | 710 resources.push_back(std::make_pair("guestViewEvents", |
711 IDR_GUEST_VIEW_EVENTS_JS)); | 711 IDR_GUEST_VIEW_EVENTS_JS)); |
712 | 712 |
713 if (content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { | 713 if (content::GuestMode::UseCrossProcessFramesForGuests()) { |
714 resources.push_back(std::make_pair("guestViewIframe", | 714 resources.push_back(std::make_pair("guestViewIframe", |
715 IDR_GUEST_VIEW_IFRAME_JS)); | 715 IDR_GUEST_VIEW_IFRAME_JS)); |
716 resources.push_back(std::make_pair("guestViewIframeContainer", | 716 resources.push_back(std::make_pair("guestViewIframeContainer", |
717 IDR_GUEST_VIEW_IFRAME_CONTAINER_JS)); | 717 IDR_GUEST_VIEW_IFRAME_CONTAINER_JS)); |
718 } | 718 } |
719 | 719 |
720 resources.push_back(std::make_pair("imageUtil", IDR_IMAGE_UTIL_JS)); | 720 resources.push_back(std::make_pair("imageUtil", IDR_IMAGE_UTIL_JS)); |
721 resources.push_back(std::make_pair("json_schema", IDR_JSON_SCHEMA_JS)); | 721 resources.push_back(std::make_pair("json_schema", IDR_JSON_SCHEMA_JS)); |
722 resources.push_back(std::make_pair("lastError", IDR_LAST_ERROR_JS)); | 722 resources.push_back(std::make_pair("lastError", IDR_LAST_ERROR_JS)); |
723 resources.push_back(std::make_pair("messaging", IDR_MESSAGING_JS)); | 723 resources.push_back(std::make_pair("messaging", IDR_MESSAGING_JS)); |
(...skipping 931 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1655 | 1655 |
1656 // Require WebView. | 1656 // Require WebView. |
1657 if (context->GetAvailability("webViewInternal").is_available()) { | 1657 if (context->GetAvailability("webViewInternal").is_available()) { |
1658 requires_guest_view_module = true; | 1658 requires_guest_view_module = true; |
1659 module_system->Require("webView"); | 1659 module_system->Require("webView"); |
1660 module_system->Require("webViewApiMethods"); | 1660 module_system->Require("webViewApiMethods"); |
1661 module_system->Require("webViewAttributes"); | 1661 module_system->Require("webViewAttributes"); |
1662 } | 1662 } |
1663 | 1663 |
1664 if (requires_guest_view_module && | 1664 if (requires_guest_view_module && |
1665 content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { | 1665 content::GuestMode::UseCrossProcessFramesForGuests()) { |
1666 module_system->Require("guestViewIframe"); | 1666 module_system->Require("guestViewIframe"); |
1667 module_system->Require("guestViewIframeContainer"); | 1667 module_system->Require("guestViewIframeContainer"); |
1668 } | 1668 } |
1669 | 1669 |
1670 // The "guestViewDeny" module must always be loaded last. It registers | 1670 // The "guestViewDeny" module must always be loaded last. It registers |
1671 // error-providing custom elements for the GuestView types that are not | 1671 // error-providing custom elements for the GuestView types that are not |
1672 // available, and thus all of those types must have been checked and loaded | 1672 // available, and thus all of those types must have been checked and loaded |
1673 // (or not loaded) beforehand. | 1673 // (or not loaded) beforehand. |
1674 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { | 1674 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { |
1675 module_system->Require("guestViewDeny"); | 1675 module_system->Require("guestViewDeny"); |
1676 } | 1676 } |
1677 } | 1677 } |
1678 | 1678 |
1679 } // namespace extensions | 1679 } // namespace extensions |
OLD | NEW |