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

Unified Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 2165523004: Force MimeHandlerView to always use BrowserPlugin (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed a typo Created 4 years, 3 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 side-by-side diff with in-line comments
Download patch
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 d0a39e22c2d7afa3dcd1fddb5d72c12c4b03d299..bd370e738c10e42e64aad6a82d29210a96fb4769 100644
--- a/content/browser/browser_plugin/browser_plugin_guest.cc
+++ b/content/browser/browser_plugin/browser_plugin_guest.cc
@@ -111,10 +111,11 @@ BrowserPluginGuest::BrowserPluginGuest(bool has_render_view,
RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Create"));
web_contents->SetBrowserPluginGuest(this);
delegate->SetGuestHost(this);
+ is_mime_handler_view_guest_ = delegate_->IsMimeHandlerViewGuest();
lfg 2016/09/02 18:29:40 Let's initialize this with the other member variab
EhsanK 2016/09/02 21:01:06 Done.
}
int BrowserPluginGuest::GetGuestProxyRoutingID() {
- if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ if (guest_mode::IsCrossProcessFrameGuest(GetWebContents())) {
// 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,7 @@ void BrowserPluginGuest::InitInternal(
if (owner_web_contents_ != owner_web_contents) {
WebContentsViewGuest* new_view = nullptr;
- if (!BrowserPluginGuestMode::UseCrossProcessFramesForGuests()) {
+ if (!guest_mode::IsCrossProcessFrameGuest(GetWebContents())) {
new_view =
static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
}
@@ -373,6 +374,12 @@ RenderWidgetHostView* BrowserPluginGuest::GetOwnerRenderWidgetHostView() {
return owner_web_contents_->GetRenderWidgetHostView();
}
+RenderWidgetHostView* BrowserPluginGuest::GetTopLevelRenderWidgetHostView() {
lfg 2016/09/02 18:29:40 Same comment as above.
EhsanK 2016/09/02 21:01:06 Done.
+ if (!owner_web_contents_)
+ return nullptr;
+ return owner_web_contents_->GetTopLevelRenderWidgetHostView();
+}
+
void BrowserPluginGuest::UpdateVisibility() {
OnSetVisibility(browser_plugin_instance_id(), visible());
}
@@ -677,9 +684,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 (guest_mode::IsCrossProcessFrameGuest(GetWebContents()))
return false;
- }
IPC_BEGIN_MESSAGE_MAP(BrowserPluginGuest, message)
IPC_MESSAGE_HANDLER(InputHostMsg_ImeCancelComposition,
@@ -927,7 +933,7 @@ 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 (guest_mode::IsCrossProcessFrameGuest(GetWebContents()))
return;
guest_visible_ = visible;

Powered by Google App Engine
This is Rietveld 408576698