| Index: content/browser/web_contents/web_contents_impl.cc
|
| diff --git a/content/browser/web_contents/web_contents_impl.cc b/content/browser/web_contents/web_contents_impl.cc
|
| index 683bd7154d435222b2627e276aa7c6a001a10d12..52bd558ab27ba544eac330b22eeeb52e99db9e15 100644
|
| --- a/content/browser/web_contents/web_contents_impl.cc
|
| +++ b/content/browser/web_contents/web_contents_impl.cc
|
| @@ -91,6 +91,7 @@
|
| #include "content/public/browser/devtools_agent_host.h"
|
| #include "content/public/browser/download_manager.h"
|
| #include "content/public/browser/download_url_parameters.h"
|
| +#include "content/public/browser/guest_mode.h"
|
| #include "content/public/browser/invalidate_type.h"
|
| #include "content/public/browser/javascript_dialog_manager.h"
|
| #include "content/public/browser/load_notification_details.h"
|
| @@ -1403,7 +1404,7 @@ void WebContentsImpl::DispatchBeforeUnload() {
|
| void WebContentsImpl::AttachToOuterWebContentsFrame(
|
| WebContents* outer_web_contents,
|
| RenderFrameHost* outer_contents_frame) {
|
| - CHECK(BrowserPluginGuestMode::UseCrossProcessFramesForGuests());
|
| + CHECK(GuestMode::IsInnerWebContentsUsingCrossProcessFrames(this));
|
| RenderFrameHostManager* render_manager = GetRenderManager();
|
|
|
| // When the WebContents being initialized has an opener, the browser side
|
| @@ -1559,8 +1560,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
| #endif
|
|
|
| if (!view_) {
|
| - if (browser_plugin_guest_ &&
|
| - BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
| + if (GuestMode::IsInnerWebContentsUsingCrossProcessFrames(this)) {
|
| view_.reset(new WebContentsViewChildFrame(
|
| this, delegate, &render_view_host_delegate_view_));
|
| } else {
|
| @@ -1570,7 +1570,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) {
|
| }
|
|
|
| if (browser_plugin_guest_ &&
|
| - !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
| + !GuestMode::IsInnerWebContentsUsingCrossProcessFrames(this)) {
|
| view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(),
|
| std::move(view_),
|
| &render_view_host_delegate_view_));
|
| @@ -4195,13 +4195,12 @@ void WebContentsImpl::RemoveBrowserPluginEmbedder() {
|
| }
|
|
|
| WebContentsImpl* WebContentsImpl::GetOuterWebContents() {
|
| - if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
| - if (node_)
|
| - return node_->outer_web_contents();
|
| - } else {
|
| - if (GetBrowserPluginGuest())
|
| - return GetBrowserPluginGuest()->embedder_web_contents();
|
| - }
|
| + if (GuestMode::IsInnerWebContentsUsingCrossProcessFrames(this) && node_)
|
| + return node_->outer_web_contents();
|
| +
|
| + if (browser_plugin_guest_)
|
| + return browser_plugin_guest_->embedder_web_contents();
|
| +
|
| return nullptr;
|
| }
|
|
|
| @@ -4631,7 +4630,8 @@ void WebContentsImpl::EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) {
|
| // then we should not create a RenderView. AttachToOuterWebContentsFrame()
|
| // already created a RenderFrameProxyHost for that purpose.
|
| if (GetBrowserPluginEmbedder() &&
|
| - BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
| + GuestMode::IsInnerWebContentsUsingCrossProcessFrames(
|
| + source_web_contents)) {
|
| return;
|
| }
|
|
|
| @@ -4652,7 +4652,8 @@ void WebContentsImpl::EnsureOpenerProxiesExist(RenderFrameHost* source_rfh) {
|
|
|
| void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node,
|
| SiteInstance* source) {
|
| - if (!BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
|
| + if (!GuestMode::IsInnerWebContentsUsingCrossProcessFrames(this) &&
|
| + browser_plugin_guest_) {
|
| frame_tree_.SetFocusedFrame(node, source);
|
| return;
|
| }
|
| @@ -4671,8 +4672,7 @@ void WebContentsImpl::SetFocusedFrame(FrameTreeNode* node,
|
|
|
| // TODO(avallee): Remove this once page focus is fixed.
|
| RenderWidgetHostImpl* rwh = node->current_frame_host()->GetRenderWidgetHost();
|
| - if (rwh && old_focused_contents != this &&
|
| - BrowserPluginGuestMode::UseCrossProcessFramesForGuests())
|
| + if (rwh && old_focused_contents != this)
|
| rwh->Focus();
|
| }
|
|
|
|
|