diff options
author | Pierre Rossi <pierre.rossi@digia.com> | 2014-01-30 18:26:21 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-12 13:15:24 +0100 |
commit | 9c198939be1ef064d1a2430a4b9991f2fe16f359 (patch) | |
tree | 1b081d0379c82c8cc34a0d80aa2846e36f37951e /src/core/web_contents_view_qt.cpp | |
parent | f2cd2e0a32e8da3a0fbff6271dd9c257d8e8867f (diff) |
[Widgets] RenderWidgetHostViewQtDelegate refactoring
Break up the delegate implementation into two distinct subclasses.
The first one offers a way for the WebPage to tap into the
RenderWidgetHostView directly, while a different implementation
that is backed by a top-level widget can be used to show WebUI
popups on screen.
This has the benefit of not having a child widget in the webview
among other things. It also fixes our popups and allows them to fall
outside the window frame.
Change-Id: I80dc1e4f21bb91ff47c75a626d330f88eacce8c6
Reviewed-by: Jocelyn Turcotte <jocelyn.turcotte@digia.com>
Diffstat (limited to 'src/core/web_contents_view_qt.cpp')
-rw-r--r-- | src/core/web_contents_view_qt.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/core/web_contents_view_qt.cpp b/src/core/web_contents_view_qt.cpp index a4cb3556e..8fdcf4679 100644 --- a/src/core/web_contents_view_qt.cpp +++ b/src/core/web_contents_view_qt.cpp @@ -61,8 +61,12 @@ void WebContentsViewQt::initialize(WebContentsAdapterClient* client) content::RenderWidgetHostView* WebContentsViewQt::CreateViewForWidget(content::RenderWidgetHost* render_widget_host) { - content::RenderWidgetHostView* view = CreateViewForPopupWidget(render_widget_host); + RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host); + Q_ASSERT(m_factoryClient); + view->setDelegate(m_factoryClient->CreateRenderWidgetHostViewQtDelegate(view, WebEngineContext::current()->renderingMode())); + if (m_client) + view->setAdapterClient(m_client); // Tell the RWHV delegate to attach itself to the native view container. view->InitAsChild(0); @@ -72,12 +76,8 @@ content::RenderWidgetHostView* WebContentsViewQt::CreateViewForWidget(content::R content::RenderWidgetHostView* WebContentsViewQt::CreateViewForPopupWidget(content::RenderWidgetHost* render_widget_host) { RenderWidgetHostViewQt *view = new RenderWidgetHostViewQt(render_widget_host); - - Q_ASSERT(m_factoryClient); - view->setDelegate(m_factoryClient->CreateRenderWidgetHostViewQtDelegate(view, WebEngineContext::current()->renderingMode())); - if (m_client) - view->setAdapterClient(m_client); - + Q_ASSERT(m_client); + view->setDelegate(m_client->CreateRenderWidgetHostViewQtDelegateForPopup(view, WebEngineContext::current()->renderingMode())); return view; } |