Index: content/browser/browser_plugin/browser_plugin_guest.cc |
diff --git a/content/browser/browser_plugin/browser_plugin_guest.cc b/content/browser/browser_plugin/browser_plugin_guest.cc |
index ceeaaa3d6b90ff861df6a592b0df611fa1827b88..d340cb01fb20ebe64b95c23bee5498e56fb3a96c 100644 |
--- a/content/browser/browser_plugin/browser_plugin_guest.cc |
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc |
@@ -114,7 +114,8 @@ BrowserPluginGuest::BrowserPluginGuest(bool has_render_view, |
} |
int BrowserPluginGuest::GetGuestProxyRoutingID() { |
- if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { |
+ if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests() && |
+ !IsMimeHandlerViewGuest()) { |
// We don't use the proxy to send postMessage in --site-per-process, since |
// we use the contentWindow directly from the frame element instead. |
return MSG_ROUTING_NONE; |
@@ -290,7 +291,8 @@ void BrowserPluginGuest::InitInternal( |
if (owner_web_contents_ != owner_web_contents) { |
WebContentsViewGuest* new_view = nullptr; |
- if (!BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { |
+ if (!BrowserPluginGuestMode::UseCrossProcessFramesForGuests() || |
+ IsMimeHandlerViewGuest()) { |
new_view = |
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); |
} |
@@ -373,6 +375,12 @@ RenderWidgetHostView* BrowserPluginGuest::GetOwnerRenderWidgetHostView() { |
return owner_web_contents_->GetRenderWidgetHostView(); |
} |
+RenderWidgetHostView* BrowserPluginGuest::GetTopLevelRenderWidgetHostView() { |
+ if (!owner_web_contents_) |
+ return nullptr; |
+ return owner_web_contents_->GetTopLevelRenderWidgetHostView(); |
+} |
+ |
void BrowserPluginGuest::UpdateVisibility() { |
OnSetVisibility(browser_plugin_instance_id(), visible()); |
} |
@@ -470,6 +478,10 @@ void BrowserPluginGuest::ResendEventToEmbedder( |
} |
} |
+bool BrowserPluginGuest::IsMimeHandlerViewGuest() const { |
+ return !!delegate_ && delegate_->IsMimeHandlerViewGuest(); |
+} |
+ |
WebContentsImpl* BrowserPluginGuest::GetWebContents() const { |
return static_cast<WebContentsImpl*>(web_contents()); |
} |
@@ -677,7 +689,8 @@ bool BrowserPluginGuest::OnMessageReceived(const IPC::Message& message) { |
// TODO(lazyboy): Fix this as part of http://crbug.com/330264. The required |
// parts of code from this class should be extracted to a separate class for |
// --site-per-process. |
- if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) { |
+ if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests() && |
+ !IsMimeHandlerViewGuest()) { |
return false; |
} |
@@ -927,7 +940,8 @@ void BrowserPluginGuest::OnSetEditCommandsForNextKeyEvent( |
void BrowserPluginGuest::OnSetVisibility(int browser_plugin_instance_id, |
bool visible) { |
// For OOPIF-<webivew>, the remote frame will handle visibility state. |
- if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) |
+ if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests() && |
+ !IsMimeHandlerViewGuest()) |
return; |
guest_visible_ = visible; |