summaryrefslogtreecommitdiffstats
path: root/src/webengine
diff options
context:
space:
mode:
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/api/qquickwebenginenewviewrequest.cpp4
-rw-r--r--src/webengine/api/qquickwebenginenewviewrequest_p.h6
-rw-r--r--src/webengine/api/qquickwebengineview.cpp10
-rw-r--r--src/webengine/api/qquickwebengineview_p.h3
-rw-r--r--src/webengine/api/qquickwebengineview_p_p.h2
5 files changed, 13 insertions, 12 deletions
diff --git a/src/webengine/api/qquickwebenginenewviewrequest.cpp b/src/webengine/api/qquickwebenginenewviewrequest.cpp
index 8af8f5b4..2aa45228 100644
--- a/src/webengine/api/qquickwebenginenewviewrequest.cpp
+++ b/src/webengine/api/qquickwebenginenewviewrequest.cpp
@@ -57,9 +57,9 @@ QQuickWebEngineView::NewViewDestination QQuickWebEngineNewViewRequest::destinati
return m_destination;
}
-bool QQuickWebEngineNewViewRequest::isPopup() const
+bool QQuickWebEngineNewViewRequest::isUserInitiated() const
{
- return m_isPopup;
+ return m_isUserInitiated;
}
void QQuickWebEngineNewViewRequest::openIn(QQuickWebEngineView *view)
diff --git a/src/webengine/api/qquickwebenginenewviewrequest_p.h b/src/webengine/api/qquickwebenginenewviewrequest_p.h
index ed762cd3..390ca278 100644
--- a/src/webengine/api/qquickwebenginenewviewrequest_p.h
+++ b/src/webengine/api/qquickwebenginenewviewrequest_p.h
@@ -52,18 +52,18 @@ QT_BEGIN_NAMESPACE
class Q_WEBENGINE_PRIVATE_EXPORT QQuickWebEngineNewViewRequest : public QObject {
Q_OBJECT
Q_PROPERTY(QQuickWebEngineView::NewViewDestination destination READ destination CONSTANT FINAL)
- Q_PROPERTY(bool popup READ isPopup CONSTANT FINAL)
+ Q_PROPERTY(bool userInitiated READ isUserInitiated CONSTANT FINAL)
public:
~QQuickWebEngineNewViewRequest();
QQuickWebEngineView::NewViewDestination destination() const;
- bool isPopup() const;
+ bool isUserInitiated() const;
Q_INVOKABLE void openIn(QQuickWebEngineView *view);
private:
QQuickWebEngineNewViewRequest();
QQuickWebEngineView::NewViewDestination m_destination;
- bool m_isPopup;
+ bool m_isUserInitiated;
QExplicitlySharedDataPointer<WebContentsAdapter> m_adapter;
friend class QQuickWebEngineViewPrivate;
};
diff --git a/src/webengine/api/qquickwebengineview.cpp b/src/webengine/api/qquickwebengineview.cpp
index c8c8bfac..e3838255 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;
diff --git a/src/webengine/api/qquickwebengineview_p.h b/src/webengine/api/qquickwebengineview_p.h
index 40bc59f4..d9284e73 100644
--- a/src/webengine/api/qquickwebengineview_p.h
+++ b/src/webengine/api/qquickwebengineview_p.h
@@ -100,7 +100,8 @@ public:
enum NewViewDestination {
NewViewInWindow,
- NewViewInTab
+ NewViewInTab,
+ NewViewInDialog
};
// must match WebContentsAdapterClient::JavaScriptConsoleMessageLevel
diff --git a/src/webengine/api/qquickwebengineview_p_p.h b/src/webengine/api/qquickwebengineview_p_p.h
index 3a84eae5..4cbca659 100644
--- a/src/webengine/api/qquickwebengineview_p_p.h
+++ b/src/webengine/api/qquickwebengineview_p_p.h
@@ -139,7 +139,7 @@ public:
virtual void loadCommitted() Q_DECL_OVERRIDE;
virtual void loadFinished(bool success, int error_code = 0, const QString &error_description = QString()) Q_DECL_OVERRIDE;
virtual void focusContainer() Q_DECL_OVERRIDE;
- virtual void adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, const QRect &) Q_DECL_OVERRIDE;
+ virtual void adoptNewWindow(WebContentsAdapter *newWebContents, WindowOpenDisposition disposition, bool userGesture, const QRect &) Q_DECL_OVERRIDE;
virtual void close() Q_DECL_OVERRIDE;
virtual void requestFullScreen(bool) Q_DECL_OVERRIDE;
virtual bool isFullScreen() const Q_DECL_OVERRIDE;