summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebengineview.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-04-11 15:12:26 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-04-15 13:55:53 +0200
commit4d1d33022a431c3108c4eb33a60d23b0f013d9b8 (patch)
tree926d53c30f686371a01c6d08e318efccb070aed2 /src/webengine/api/qquickwebengineview.cpp
parent57df12f215cb02e05ee8f197e0843bebd4574a53 (diff)
Fix how NewPopupDisposition is exposed in QQuickWebEngineView
I initially misintepreted the meaning of the enum, assuming that it meant that the window should possibly be blocked. The user_gesture parameter in WebContentsDelegate::AddNewContents is actually doing this, while the popup disposition means that JavaScript requested the window to be opened without one of the standard decoration (i.e. status bar, menu bar, tool bar, etc.). Update the QtQuick API to reflect this, renaming the "isPopup" parameter to a more familiar "isUserInitiated". The popup disposition is named "dialog" to match the previous QWebPage::WebModalDialog enum. Change-Id: Ib0c4bc53671fcf0dd9499aa1be2bbc8c494ba49e Reviewed-by: Michael Bruning <michael.bruning@digia.com>
Diffstat (limited to 'src/webengine/api/qquickwebengineview.cpp')
-rw-r--r--src/webengine/api/qquickwebengineview.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index c8c8bfac0..e3838255e 100644
--- a/src/webengine/api/qquickwebengineview.cpp
+++ b/src/webengine/api/qquickwebengineview.cpp
@@ -295,22 +295,22 @@ void QQuickWebEngineViewPrivate::focusContainer()
q->forceActiveFocus();
}
-void QQuickWebEngineViewPrivate::adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, const QRect &)
+void QQuickWebEngineViewPrivate::adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &)
{
QQuickWebEngineNewViewRequest request;
// This increases the ref-count of newWebContents and will tell Chromium
// to start loading it and possibly return it to its parent page window.open().
request.m_adapter = newWebContents;
- request.m_isPopup = false;
+ request.m_isUserInitiated = userGesture;
switch (disposition) {
- case WebContentsAdapterClient::NewPopupDisposition:
- request.m_isPopup = true;
- // fall through
case WebContentsAdapterClient::NewForegroundTabDisposition:
case WebContentsAdapterClient::NewBackgroundTabDisposition:
request.m_destination = QQuickWebEngineView::NewViewInTab;
break;
+ case WebContentsAdapterClient::NewPopupDisposition:
+ request.m_destination = QQuickWebEngineView::NewViewInDialog;
+ break;
case WebContentsAdapterClient::NewWindowDisposition:
request.m_destination = QQuickWebEngineView::NewViewInWindow;
break;