diff options
author | Jocelyn Turcotte <jocelyn.turcotte@digia.com> | 2013-08-09 18:27:15 +0200 |
---|---|---|
committer | Zeno Albisser <zeno.albisser@digia.com> | 2013-08-12 12:09:29 +0200 |
commit | 4fdbee3bc4526d4a43b798a095e5168633eb99f5 (patch) | |
tree | 11c27e2cba9e383a150838a29c3873a1ed484042 /lib/web_contents_view_qt.cpp | |
parent | 2ee75c4411394981f5bbf50c0edffe42b6343c90 (diff) |
Delay the RWHVDelegate parenting until it's been attached to its RWHV.
This avoids the RWHV being accessed before being attached to
the delegate when attaching the later to the view's layout.
Change-Id: I5fffef60fdd7203cfb4ced807b5475aac676ea09
Reviewed-by: Zeno Albisser <zeno.albisser@digia.com>
Diffstat (limited to 'lib/web_contents_view_qt.cpp')
-rw-r--r-- | lib/web_contents_view_qt.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/web_contents_view_qt.cpp b/lib/web_contents_view_qt.cpp index f447349a8..09863ca9e 100644 --- a/lib/web_contents_view_qt.cpp +++ b/lib/web_contents_view_qt.cpp @@ -52,6 +52,10 @@ content::RenderWidgetHostView* WebContentsViewQt::CreateViewForWidget(content::R RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host); RenderWidgetHostViewQtDelegate* viewDelegate = m_client->CreateRenderWidgetHostViewQtDelegate(); view->SetDelegate(viewDelegate); + // The delegate has been bound to its view, now initialize it. + // gfx::NativeView logically maps to our client here but the reinterpret_cast is still ugly. + // The alternative is be to have a duplicated method with the proper signature. + view->InitAsChild(reinterpret_cast<gfx::NativeView>(m_client)); return view; } |