Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1431)

Side by Side Diff: extensions/renderer/dispatcher.cc

Issue 1865103002: Implement ExtensionView based on out-of-process iframes GuestView. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@extensionoptions
Patch Set: addressing comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/apps/guest_view/extension_view/extension_view_browsertest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <utility> 9 #include <utility>
10 10
(...skipping 1557 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 *bind_name = split.back(); 1568 *bind_name = split.back();
1569 1569
1570 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context)) 1570 return bind_object.IsEmpty() ? AsObjectOrEmpty(GetOrCreateChrome(context))
1571 : bind_object; 1571 : bind_object;
1572 } 1572 }
1573 1573
1574 void Dispatcher::RequireGuestViewModules(ScriptContext* context) { 1574 void Dispatcher::RequireGuestViewModules(ScriptContext* context) {
1575 Feature::Context context_type = context->context_type(); 1575 Feature::Context context_type = context->context_type();
1576 ModuleSystem* module_system = context->module_system(); 1576 ModuleSystem* module_system = context->module_system();
1577 1577
1578 // Only set if |context| is capable of running guests in OOPIF. Used to
1579 // require additional module overrides.
1580 bool guest_view_required = false;
1581
1582 // Require AppView. 1578 // Require AppView.
1583 if (context->GetAvailability("appViewEmbedderInternal").is_available()) { 1579 if (context->GetAvailability("appViewEmbedderInternal").is_available()) {
1584 module_system->Require("appView"); 1580 module_system->Require("appView");
1585
1586 guest_view_required = true;
1587 } 1581 }
1588 1582
1589 // Require ExtensionOptions. 1583 // Require ExtensionOptions.
1590 if (context->GetAvailability("extensionOptionsInternal").is_available()) { 1584 if (context->GetAvailability("extensionOptionsInternal").is_available()) {
1591 module_system->Require("extensionOptions"); 1585 module_system->Require("extensionOptions");
1592 module_system->Require("extensionOptionsAttributes"); 1586 module_system->Require("extensionOptionsAttributes");
1593
1594 guest_view_required = true;
1595 } 1587 }
1596 1588
1597 // Require ExtensionView. 1589 // Require ExtensionView.
1598 if (context->GetAvailability("extensionViewInternal").is_available()) { 1590 if (context->GetAvailability("extensionViewInternal").is_available()) {
1599 module_system->Require("extensionView"); 1591 module_system->Require("extensionView");
1600 module_system->Require("extensionViewApiMethods"); 1592 module_system->Require("extensionViewApiMethods");
1601 module_system->Require("extensionViewAttributes"); 1593 module_system->Require("extensionViewAttributes");
1602 } 1594 }
1603 1595
1604 // Require WebView. 1596 // Require WebView.
1605 if (context->GetAvailability("webViewInternal").is_available()) { 1597 if (context->GetAvailability("webViewInternal").is_available()) {
1606 module_system->Require("webView"); 1598 module_system->Require("webView");
1607 module_system->Require("webViewApiMethods"); 1599 module_system->Require("webViewApiMethods");
1608 module_system->Require("webViewAttributes"); 1600 module_system->Require("webViewAttributes");
1609 if (context->GetAvailability("webViewExperimentalInternal") 1601 if (context->GetAvailability("webViewExperimentalInternal")
1610 .is_available()) { 1602 .is_available()) {
1611 module_system->Require("webViewExperimental"); 1603 module_system->Require("webViewExperimental");
1612 } 1604 }
1613
1614 guest_view_required = true;
1615 } 1605 }
1616 1606
1617 if (guest_view_required && 1607 if (content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
1618 content::BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
1619 module_system->Require("guestViewIframe"); 1608 module_system->Require("guestViewIframe");
1620 module_system->Require("guestViewIframeContainer"); 1609 module_system->Require("guestViewIframeContainer");
1621 } 1610 }
1622 1611
1623 // The "guestViewDeny" module must always be loaded last. It registers 1612 // The "guestViewDeny" module must always be loaded last. It registers
1624 // error-providing custom elements for the GuestView types that are not 1613 // error-providing custom elements for the GuestView types that are not
1625 // available, and thus all of those types must have been checked and loaded 1614 // available, and thus all of those types must have been checked and loaded
1626 // (or not loaded) beforehand. 1615 // (or not loaded) beforehand.
1627 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) { 1616 if (context_type == Feature::BLESSED_EXTENSION_CONTEXT) {
1628 module_system->Require("guestViewDeny"); 1617 module_system->Require("guestViewDeny");
1629 } 1618 }
1630 } 1619 }
1631 1620
1632 } // namespace extensions 1621 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/apps/guest_view/extension_view/extension_view_browsertest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698