diff --git a/atom/browser/osr/osr_web_contents_view.cc b/atom/browser/osr/osr_web_contents_view.cc index b9219f17122f..0e10abf6a034 100644 --- a/atom/browser/osr/osr_web_contents_view.cc +++ b/atom/browser/osr/osr_web_contents_view.cc @@ -5,6 +5,7 @@ #include "atom/browser/osr/osr_web_contents_view.h" #include "atom/common/api/api_messages.h" +#include "content/browser/web_contents/web_contents_impl.h" #include "content/public/browser/render_view_host.h" #include "third_party/WebKit/public/platform/WebScreenInfo.h" #include "ui/display/screen.h" @@ -112,11 +113,21 @@ content::RenderWidgetHostViewBase* OffScreenWebContentsView::CreateViewForPopupWidget( content::RenderWidgetHost* render_widget_host) { auto relay = NativeWindowRelay::FromWebContents(web_contents_); + + content::WebContentsImpl *web_contents_impl = + static_cast(web_contents_); + + OffScreenRenderWidgetHostView *view = + static_cast( + web_contents_impl->GetOuterWebContents() + ? web_contents_impl->GetOuterWebContents()->GetRenderWidgetHostView() + : web_contents_impl->GetRenderWidgetHostView()); + return new OffScreenRenderWidgetHostView( transparent_, callback_, render_widget_host, - GetView(), + view, relay->window.get()); }