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 26e6d0a1768a028b7e8fab6b4c62e8a64d574b45..6c85752f70a6150d124ab38ad68cbc385263a18a 100644 |
--- a/content/browser/web_contents/web_contents_impl.cc |
+++ b/content/browser/web_contents/web_contents_impl.cc |
@@ -93,6 +93,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_from_memory_cache_details.h" |
@@ -1402,7 +1403,7 @@ void WebContentsImpl::DispatchBeforeUnload() { |
void WebContentsImpl::AttachToOuterWebContentsFrame( |
WebContents* outer_web_contents, |
RenderFrameHost* outer_contents_frame) { |
- CHECK(BrowserPluginGuestMode::UseCrossProcessFramesForGuests()); |
+ CHECK(guest_mode::IsCrossProcessFrameGuest(this)); |
RenderFrameHostManager* render_manager = GetRenderManager(); |
// When the WebContents being initialized has an opener, the browser side |
@@ -1558,8 +1559,7 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { |
#endif |
if (!view_) { |
- if (browser_plugin_guest_ && |
- BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { |
+ if (guest_mode::IsCrossProcessFrameGuest(this)) { |
view_.reset(new WebContentsViewChildFrame( |
this, delegate, &render_view_host_delegate_view_)); |
} else { |
@@ -1569,7 +1569,8 @@ void WebContentsImpl::Init(const WebContents::CreateParams& params) { |
} |
if (browser_plugin_guest_ && |
- !BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { |
+ (browser_plugin_guest_->is_mime_handler_view_guest() || |
+ !BrowserPluginGuestMode::UseCrossProcessFramesForGuests())) { |
lfg
2016/09/02 18:29:40
Can we write this as (browser_plugin_guest_ && !gu
EhsanK
2016/09/02 21:01:06
Yes. Thanks.
|
view_.reset(new WebContentsViewGuest(this, browser_plugin_guest_.get(), |
std::move(view_), |
&render_view_host_delegate_view_)); |
@@ -4199,13 +4200,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 (guest_mode::IsCrossProcessFrameGuest(this) && node_) |
+ return node_->outer_web_contents(); |
+ |
+ if (browser_plugin_guest_) |
+ return browser_plugin_guest_->embedder_web_contents(); |
+ |
return nullptr; |
} |
@@ -4635,7 +4635,7 @@ 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()) { |
+ guest_mode::IsCrossProcessFrameGuest(source_web_contents)) { |
return; |
} |