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

Unified Diff: components/guest_view/browser/guest_view_base.cc

Issue 2417693002: Allow MimeHandlerViewGuest be embedded inside OOPIFs (Closed)
Patch Set: Fixed an input routing issue with nested browser plugings Created 4 years, 1 month 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: components/guest_view/browser/guest_view_base.cc
diff --git a/components/guest_view/browser/guest_view_base.cc b/components/guest_view/browser/guest_view_base.cc
index e2ffccee70d4728e19726a3b7aea8f4c93c49aaa..f2e059cf90addb8b50e136a8265d7aa47d91173c 100644
--- a/components/guest_view/browser/guest_view_base.cc
+++ b/components/guest_view/browser/guest_view_base.cc
@@ -20,6 +20,7 @@
#include "content/public/browser/render_frame_host.h"
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/render_view_host.h"
+#include "content/public/browser/render_widget_host.h"
#include "content/public/browser/render_widget_host_view.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/page_zoom.h"
@@ -416,9 +417,9 @@ void GuestViewBase::DidAttach(int guest_proxy_routing_id) {
DidAttachToEmbedder();
// Inform the associated GuestViewContainer that the contentWindow is ready.
- embedder_web_contents()->Send(new GuestViewMsg_GuestAttached(
- element_instance_id_,
- guest_proxy_routing_id));
+ GetOwnerFrame()->GetView()->GetRenderWidgetHost()->Send(
+ new GuestViewMsg_GuestAttached(element_instance_id_,
+ guest_proxy_routing_id));
SendQueuedEvents();
}
@@ -726,6 +727,12 @@ void GuestViewBase::FindReply(WebContents* source,
}
}
+content::RenderFrameHost* GuestViewBase::GetOwnerFrame() {
+ if (GetOwnerWebContents())
+ return GetOwnerWebContents()->GetMainFrame();
+ return nullptr;
+}
+
void GuestViewBase::OnZoomChanged(
const zoom::ZoomController::ZoomChangedEventData& data) {
if (data.web_contents == embedder_web_contents()) {

Powered by Google App Engine
This is Rietveld 408576698