diff options
author | Kirill Burtsev <kirill.burtsev@qt.io> | 2021-07-13 12:34:48 +0200 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2021-08-19 21:53:10 +0000 |
commit | a18bd92cd95d482792aacd4d164d066122ac14c6 (patch) | |
tree | 62eaf9323d7d42e7f57dd5bc92bc1b528764c30d | |
parent | adc3ebe1fb26df925a15c63cc59c0910cf63d535 (diff) |
Rename quick's 'newViewRequested' to 'newWindowRequested'
Match new api within the page API.
Change-Id: Ib2af2f5270f368813cecab8f1c6b7366d3b7172f
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
(cherry picked from commit 339017523ed418a9dc48d9343e5dc63eb1f29ec1)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
14 files changed, 82 insertions, 82 deletions
diff --git a/examples/webengine/quicknanobrowser/BrowserWindow.qml b/examples/webengine/quicknanobrowser/BrowserWindow.qml index 32955e140..0da1bc043 100644 --- a/examples/webengine/quicknanobrowser/BrowserWindow.qml +++ b/examples/webengine/quicknanobrowser/BrowserWindow.qml @@ -571,21 +571,21 @@ ApplicationWindow { sslDialog.enqueue(error); } - onNewViewRequested: function(request) { + onNewWindowRequested: function(request) { if (!request.userInitiated) console.warn("Blocked a popup window."); - else if (request.destination === WebEngineNewViewRequest.InNewTab) { + else if (request.destination === WebEngineNewWindowRequest.InNewTab) { var tab = tabBar.createTab(currentWebView.profile, true, request.requestedUrl); - tab.acceptAsNewView(request); - } else if (request.destination === WebEngineNewViewRequest.InNewBackgroundTab) { + tab.acceptAsNewWindow(request); + } else if (request.destination === WebEngineNewWindowRequest.InNewBackgroundTab) { var backgroundTab = tabBar.createTab(currentWebView.profile, false); - backgroundTab.acceptAsNewView(request); - } else if (request.destination === WebEngineNewViewRequest.InNewDialog) { + backgroundTab.acceptAsNewWindow(request); + } else if (request.destination === WebEngineNewWindowRequest.InNewDialog) { var dialog = applicationRoot.createDialog(currentWebView.profile); - dialog.currentWebView.acceptAsNewView(request); + dialog.currentWebView.acceptAsNewWindow(request); } else { var window = applicationRoot.createWindow(currentWebView.profile); - window.currentWebView.acceptAsNewView(request); + window.currentWebView.acceptAsNewWindow(request); } } @@ -672,7 +672,7 @@ ApplicationWindow { anchors.left: parent.left anchors.right: parent.right anchors.bottom: parent.bottom - onNewViewRequested: function(request) { + onNewWindowRequested: function(request) { var tab = tabBar.createTab(currentWebView.profile); request.openIn(tab); } diff --git a/src/core/api/qwebenginenewwindowrequest.cpp b/src/core/api/qwebenginenewwindowrequest.cpp index 9fc025c0e..2048dea73 100644 --- a/src/core/api/qwebenginenewwindowrequest.cpp +++ b/src/core/api/qwebenginenewwindowrequest.cpp @@ -59,16 +59,16 @@ QT_BEGIN_NAMESPACE */ /*! - \qmltype WebEngineNewViewRequest - \instantiates QWebEngineNewWindowRequest + \qmltype WebEngineNewWindowRequest + \instantiates QQuickWebEngineNewWindowRequest \inqmlmodule QtWebEngineQuick - \since QtWebEngine 1.1 + \since QtWebEngine 1.12 - \brief A utility type for the WebEngineView::newViewRequested signal. + \brief A utility type for the WebEngineView::newWindowRequested signal. Contains information about a request to load a page in a separate web engine view. - \sa WebEngineView::newViewRequested + \sa WebEngineView::newWindowRequested */ /*! @@ -87,17 +87,17 @@ QT_BEGIN_NAMESPACE */ /*! - \qmlproperty enumeration WebEngineNewViewRequest::DestinationType + \qmlproperty enumeration WebEngineNewWindowRequest::DestinationType Describes how to open a new view: - \value WebEngineNewViewRequest.InNewWindow + \value WebEngineNewWindowRequest.InNewWindow In a separate window. - \value WebEngineNewViewRequest.InNewTab + \value WebEngineNewWindowRequest.InNewTab In a tab of the same window. - \value WebEngineNewViewRequest.InNewDialog + \value WebEngineNewWindowRequest.InNewDialog In a window without a tab bar, toolbar, or URL bar. - \value WebEngineNewViewRequest.InNewBackgroundTab + \value WebEngineNewWindowRequest.InNewBackgroundTab In a tab of the same window, without hiding the currently visible web engine view. */ @@ -121,7 +121,7 @@ QWebEngineNewWindowRequest::~QWebEngineNewWindowRequest() \brief The type of window that is requested. */ /*! - \qmlproperty WebEngineNewViewRequest::DestinationType WebEngineNewViewRequest::destination + \qmlproperty WebEngineNewWindowRequest::DestinationType WebEngineNewWindowRequest::destination \brief The type of window that is requested. */ QWebEngineNewWindowRequest::DestinationType QWebEngineNewWindowRequest::destination() const @@ -134,7 +134,7 @@ QWebEngineNewWindowRequest::DestinationType QWebEngineNewWindowRequest::destinat \brief The URL that is requested for the new page. */ /*! - \qmlproperty QUrl WebEngineNewViewRequest::requestedUrl + \qmlproperty QUrl WebEngineNewWindowRequest::requestedUrl \brief The URL that is requested for the new page. \since QtWebEngine 1.5 */ @@ -148,7 +148,7 @@ QUrl QWebEngineNewWindowRequest::requestedUrl() const \brief The size that is requested for the new page. */ /*! - \qmlproperty QRect WebEngineNewViewRequest::requestedGeometry + \qmlproperty QRect WebEngineNewWindowRequest::requestedGeometry \brief The size that is requested for the new page. \since QtWebEngine 2.0 */ @@ -164,7 +164,7 @@ QRect QWebEngineNewWindowRequest::requestedGeometry() const You can use this property to block automatic \e popups. */ /*! - \qmlproperty bool WebEngineNewViewRequest::userInitiated + \qmlproperty bool WebEngineNewWindowRequest::userInitiated Whether this window request was directly triggered as the result of a keyboard or mouse event. You can use this property to block automatic \e popups. diff --git a/src/webenginequick/CMakeLists.txt b/src/webenginequick/CMakeLists.txt index 7fd84c0a4..ac9c905e2 100644 --- a/src/webenginequick/CMakeLists.txt +++ b/src/webenginequick/CMakeLists.txt @@ -21,7 +21,7 @@ qt_internal_add_qml_module(WebEngineQuick api/qquickwebenginedownloadrequest.cpp api/qquickwebenginedownloadrequest_p.h api/qquickwebenginefaviconprovider.cpp api/qquickwebenginefaviconprovider_p_p.h - api/qquickwebenginenewviewrequest.cpp api/qquickwebenginenewviewrequest_p.h + api/qquickwebenginenewwindowrequest.cpp api/qquickwebenginenewwindowrequest_p.h api/qquickwebengineprofile.cpp api/qquickwebengineprofile.h api/qquickwebengineprofile_p.h api/qquickwebenginescriptcollection.cpp api/qquickwebenginescriptcollection_p.h api/qquickwebenginesettings.cpp api/qquickwebenginesettings_p.h diff --git a/src/webenginequick/api/qquickwebenginenewviewrequest.cpp b/src/webenginequick/api/qquickwebenginenewwindowrequest.cpp index e2e20f35e..fb36babfa 100644 --- a/src/webenginequick/api/qquickwebenginenewviewrequest.cpp +++ b/src/webenginequick/api/qquickwebenginenewwindowrequest.cpp @@ -37,7 +37,7 @@ ** ****************************************************************************/ -#include "qquickwebenginenewviewrequest_p.h" +#include "qquickwebenginenewwindowrequest_p.h" #include "qquickwebengineview_p.h" #include "web_contents_adapter_client.h" @@ -47,7 +47,7 @@ QT_BEGIN_NAMESPACE /*! \internal */ -QQuickWebEngineNewViewRequest::QQuickWebEngineNewViewRequest(DestinationType dest, const QRect &rect, const QUrl &url, +QQuickWebEngineNewWindowRequest::QQuickWebEngineNewWindowRequest(DestinationType dest, const QRect &rect, const QUrl &url, bool user, QSharedPointer<QtWebEngineCore::WebContentsAdapter> adapter, QObject *parent) @@ -56,22 +56,22 @@ QQuickWebEngineNewViewRequest::QQuickWebEngineNewViewRequest(DestinationType des } /*! - \qmlmethod WebEngineNewViewRequest::openIn(WebEngineView view) + \qmlmethod WebEngineNewWindowRequest::openIn(WebEngineView view) Opens the requested page in the new web engine view \a view. State and history of the view and the page possibly loaded in it will be lost. - \sa WebEngineView::newViewRequested + \sa WebEngineView::newWindowRequested */ /*! \internal */ -void QQuickWebEngineNewViewRequest::openIn(QQuickWebEngineView *view) +void QQuickWebEngineNewWindowRequest::openIn(QQuickWebEngineView *view) { if (!view) { - qWarning("Trying to open a WebEngineNewViewRequest in an invalid WebEngineView."); + qWarning("Trying to open a WebEngineNewWindowRequest in an invalid WebEngineView."); return; } - view->acceptAsNewView(this); + view->acceptAsNewWindow(this); } QT_END_NAMESPACE diff --git a/src/webenginequick/api/qquickwebenginenewviewrequest_p.h b/src/webenginequick/api/qquickwebenginenewwindowrequest_p.h index 4849bc6b8..df5e7234b 100644 --- a/src/webenginequick/api/qquickwebenginenewviewrequest_p.h +++ b/src/webenginequick/api/qquickwebenginenewwindowrequest_p.h @@ -59,11 +59,11 @@ QT_BEGIN_NAMESPACE class QQuickWebEngineView; -class Q_WEBENGINEQUICK_PRIVATE_EXPORT QQuickWebEngineNewViewRequest : public QWebEngineNewWindowRequest +class Q_WEBENGINEQUICK_PRIVATE_EXPORT QQuickWebEngineNewWindowRequest : public QWebEngineNewWindowRequest { Q_OBJECT public: - QML_NAMED_ELEMENT(WebEngineNewViewRequest) + QML_NAMED_ELEMENT(WebEngineNewWindowRequest) QML_ADDED_IN_VERSION(1, 1) QML_EXTRA_VERSION(2, 0) QML_UNCREATABLE("") @@ -71,7 +71,7 @@ public: Q_INVOKABLE void openIn(QQuickWebEngineView *); private: - QQuickWebEngineNewViewRequest(DestinationType, const QRect &, const QUrl &, bool, + QQuickWebEngineNewWindowRequest(DestinationType, const QRect &, const QUrl &, bool, QSharedPointer<QtWebEngineCore::WebContentsAdapter>, QObject * = nullptr); diff --git a/src/webenginequick/api/qquickwebengineview.cpp b/src/webenginequick/api/qquickwebengineview.cpp index 22dea9121..562814128 100644 --- a/src/webenginequick/api/qquickwebengineview.cpp +++ b/src/webenginequick/api/qquickwebengineview.cpp @@ -42,7 +42,7 @@ #include "qquickwebengineclientcertificateselection_p.h" #include "qquickwebenginedialogrequests_p.h" #include "qquickwebenginefaviconprovider_p_p.h" -#include "qquickwebenginenewviewrequest_p.h" +#include "qquickwebenginenewwindowrequest_p.h" #include "qquickwebengineprofile.h" #include "qquickwebengineprofile_p.h" #include "qquickwebenginescriptcollection_p.h" @@ -496,10 +496,10 @@ QQuickWebEngineViewPrivate::adoptNewWindow(QSharedPointer<WebContentsAdapter> ne { Q_Q(QQuickWebEngineView); Q_ASSERT(newWebContents); - QQuickWebEngineNewViewRequest request(toDestinationType(disposition), geometry, + QQuickWebEngineNewWindowRequest request(toDestinationType(disposition), geometry, targetUrl, userGesture, newWebContents); - Q_EMIT q->newViewRequested(&request); + Q_EMIT q->newWindowRequested(&request); if (request.d_ptr->isRequestHandled) return newWebContents; @@ -758,7 +758,7 @@ void QQuickWebEngineViewPrivate::adoptWebContents(WebContentsAdapter *webContent { if (!webContents) { qWarning("Trying to open an empty request, it was either already used or was invalidated." - "\nYou must complete the request synchronously within the newViewRequested signal handler." + "\nYou must complete the request synchronously within the newWindowRequested signal handler." " If a view hasn't been adopted before returning, the request will be invalidated."); return; } @@ -1622,13 +1622,13 @@ void QQuickWebEngineView::itemChange(ItemChange change, const ItemChangeData &va QQuickItem::itemChange(change, value); } -void QQuickWebEngineView::acceptAsNewView(QWebEngineNewWindowRequest *request) +void QQuickWebEngineView::acceptAsNewWindow(QWebEngineNewWindowRequest *request) { Q_D(QQuickWebEngineView); if (!request || (!request->d_ptr->adapter && !request->requestedUrl().isValid()) || request->d_ptr->isRequestHandled) { qWarning("Trying to open an empty request, it was either already used or was invalidated." - "\nYou must complete the request synchronously within the newViewRequested signal handler." + "\nYou must complete the request synchronously within the newWindowRequested signal handler." " If a view hasn't been adopted before returning, the request will be invalidated."); return; } @@ -1730,16 +1730,16 @@ void QQuickWebEngineView::triggerWebAction(WebAction action) break; case OpenLinkInNewWindow: if (d->m_contextMenuRequest->filteredLinkUrl().isValid()) { - QQuickWebEngineNewViewRequest request(QWebEngineNewWindowRequest::InNewWindow, QRect(), + QQuickWebEngineNewWindowRequest request(QWebEngineNewWindowRequest::InNewWindow, QRect(), d->m_contextMenuRequest->filteredLinkUrl(), true, nullptr); - Q_EMIT newViewRequested(&request); + Q_EMIT newWindowRequested(&request); } break; case OpenLinkInNewTab: if (d->m_contextMenuRequest->filteredLinkUrl().isValid()) { - QQuickWebEngineNewViewRequest request(QWebEngineNewWindowRequest::InNewBackgroundTab, QRect(), + QQuickWebEngineNewWindowRequest request(QWebEngineNewWindowRequest::InNewBackgroundTab, QRect(), d->m_contextMenuRequest->filteredLinkUrl(), true, nullptr); - Q_EMIT newViewRequested(&request); + Q_EMIT newWindowRequested(&request); } break; case CopyLinkToClipboard: diff --git a/src/webenginequick/api/qquickwebengineview_p.h b/src/webenginequick/api/qquickwebengineview_p.h index ab891f4e2..22617dd7b 100644 --- a/src/webenginequick/api/qquickwebengineview_p.h +++ b/src/webenginequick/api/qquickwebengineview_p.h @@ -71,7 +71,7 @@ class QQuickWebEngineClientCertificateSelection; class QQuickWebEngineColorDialogRequest; class QQuickWebEngineFileDialogRequest; class QQuickWebEngineJavaScriptDialogRequest; -class QQuickWebEngineNewViewRequest; +class QQuickWebEngineNewWindowRequest; class QQuickWebEngineProfile; class QQuickWebEngineSettings; class QQuickWebEngineTooltipRequest; @@ -444,7 +444,7 @@ public: void setWebChannelWorld(uint); Q_REVISION(1,8) Q_INVOKABLE QQuickWebEngineAction *action(WebAction action); - Q_INVOKABLE void acceptAsNewView(QWebEngineNewWindowRequest *request); + Q_INVOKABLE void acceptAsNewWindow(QWebEngineNewWindowRequest *request); bool isAudioMuted() const; void setAudioMuted(bool muted); @@ -499,7 +499,6 @@ Q_SIGNALS: Q_REVISION(1,1) void fullScreenRequested(const QWebEngineFullScreenRequest &request); Q_REVISION(1,1) void isFullScreenChanged(); Q_REVISION(1,1) void featurePermissionRequested(const QUrl &securityOrigin, Feature feature); - Q_REVISION(1,1) void newViewRequested(QQuickWebEngineNewViewRequest *request); Q_REVISION(1,1) void zoomFactorChanged(qreal arg); Q_REVISION(1,1) void profileChanged(); Q_REVISION(1,1) void webChannelChanged(); @@ -532,6 +531,7 @@ Q_SIGNALS: Q_REVISION(1,11) void renderProcessPidChanged(qint64 pid); Q_REVISION(1,11) void canGoBackChanged(); Q_REVISION(1,11) void canGoForwardChanged(); + Q_REVISION(1,12) void newWindowRequested(QQuickWebEngineNewWindowRequest *request); protected: void geometryChange(const QRectF &newGeometry, const QRectF &oldGeometry) override; diff --git a/src/webenginequick/doc/snippets/qtwebengine_webengineview_newviewrequested.qml b/src/webenginequick/doc/snippets/qtwebengine_webengineview_newviewrequested.qml index 70afea2b9..0297a62fd 100644 --- a/src/webenginequick/doc/snippets/qtwebengine_webengineview_newviewrequested.qml +++ b/src/webenginequick/doc/snippets/qtwebengine_webengineview_newviewrequested.qml @@ -74,9 +74,9 @@ QtObject { // Handle the signal. Dynamically create the window and // use its WebEngineView as the destination of our request. - onNewViewRequested: function(request) { + onNewWindowRequested: function(request) { var newWindow = windowComponent.createObject(windowParent); - newWindow.webView.acceptAsNewView(request); + newWindow.webView.acceptAsNewWindow(request); } } } diff --git a/src/webenginequick/doc/src/webengineview_lgpl.qdoc b/src/webenginequick/doc/src/webengineview_lgpl.qdoc index 7c13d140a..0d3b66d62 100644 --- a/src/webenginequick/doc/src/webengineview_lgpl.qdoc +++ b/src/webenginequick/doc/src/webengineview_lgpl.qdoc @@ -74,10 +74,10 @@ \section2 Interaction By default, links to different pages load within the same WebEngineView object, but web sites - may request them to be opened as a new tab, window, or dialog. The \l newViewRequested() signal + may request them to be opened as a new tab, window, or dialog. The \l newWindowRequested() signal is emitted when a request to load the page in a separate web engine view is issued. The NewViewDestination property describes how the new view should be opened. In addition, the - WebEngineNewViewRequest utility type can be used to load web pages in separate web engine views. + WebEngineNewWindowRequest utility type can be used to load web pages in separate web engine views. The \l findText() method can be used to search for a string on a web page, using the options described by \l FindFlags. @@ -570,8 +570,8 @@ */ /*! - \qmlsignal WebEngineView::newViewRequested(WebEngineNewViewRequest request) - \since QtWebEngine 1.1 + \qmlsignal WebEngineView::newWindowRequested(WebEngineNewWindowRequest request) + \since QtWebEngine 2.0 This signal is emitted when \a request is issued to load a page in a separate web engine view. This can either be because the current page requested it explicitly @@ -579,23 +579,23 @@ while holding Shift, Ctrl, or a built-in combination that triggers the page to open in a new window. - The signal is handled by calling acceptAsNewView() on the destination view. + The signal is handled by calling acceptAsNewWindow() on the destination view. If this signal is not handled, the requested load will fail. An example implementation: \snippet qtwebengine_webengineview_newviewrequested.qml 0 - \sa WebEngineNewViewRequest, {WebEngine Quick Nano Browser} + \sa WebEngineNewWindowRequest, {WebEngine Quick Nano Browser} */ /*! - \qmlmethod void WebEngineView::acceptAsNewView(QWebEngineNewWindowRequest *request) + \qmlmethod void WebEngineView::acceptAsNewWindow(QWebEngineNewWindowRequest *request) \since QtWebEngine 2.0 - Handle the newViewRequested signal by opening the \a request in this view. + Handle the newWindowRequested signal by opening the \a request in this view. - \sa newViewRequested + \sa newWindowRequested */ /*! @@ -765,10 +765,10 @@ Open the current link in the current window. (Added in Qt 5.6) \value WebEngineView.OpenLinkInNewWindow Open the current link in a new window. Requires a handler for the - \l newViewRequested() signal. (Added in Qt 5.6) + \l newWindowRequested() signal. (Added in Qt 5.6) \value WebEngineView.OpenLinkInNewTab Open the current link in a new tab. Requires a handler for the - \l newViewRequested() signal. (Added in Qt 5.6) + \l newWindowRequested() signal. (Added in Qt 5.6) \value WebEngineView.CopyLinkToClipboard Copy the current link to the clipboard. (Added in Qt 5.6) \value WebEngineView.CopyImageToClipboard @@ -804,7 +804,7 @@ Save the current web page to disk. (Added in Qt 5.7) \value WebEngineView.ViewSource Show the source of the current page in a new tab. Requires a handler for the - \l newViewRequested() signal. (Added in Qt 5.8) + \l newWindowRequested() signal. (Added in Qt 5.8) \value WebEngineView.ToggleBold Toggles boldness for the selection or at the cursor position. diff --git a/tests/auto/quick/publicapi/tst_publicapi.cpp b/tests/auto/quick/publicapi/tst_publicapi.cpp index fe0b9d2b4..d8767edb7 100644 --- a/tests/auto/quick/publicapi/tst_publicapi.cpp +++ b/tests/auto/quick/publicapi/tst_publicapi.cpp @@ -52,7 +52,7 @@ #include <private/qquickwebengineclientcertificateselection_p.h> #include <private/qquickwebenginedialogrequests_p.h> #include <private/qquickwebenginedownloadrequest_p.h> -#include <private/qquickwebenginenewviewrequest_p.h> +#include <private/qquickwebenginenewwindowrequest_p.h> #include <private/qquickwebenginesettings_p.h> #include <private/qquickwebenginesingleton_p.h> @@ -80,7 +80,7 @@ static const QList<const QMetaObject *> typesToCheck = QList<const QMetaObject * << &QQuickWebEngineJavaScriptDialogRequest::staticMetaObject << &QQuickWebEngineColorDialogRequest::staticMetaObject << &QQuickWebEngineFileDialogRequest::staticMetaObject - << &QQuickWebEngineNewViewRequest::staticMetaObject + << &QQuickWebEngineNewWindowRequest::staticMetaObject << &QQuickWebEngineTooltipRequest::staticMetaObject << &QWebEngineContextMenuRequest::staticMetaObject << &QWebEngineCertificateError::staticMetaObject @@ -343,7 +343,7 @@ static const QStringList expectedAPI = QStringList() << "QWebEngineNewWindowRequest.InNewDialog --> DestinationType" << "QWebEngineNewWindowRequest.InNewTab --> DestinationType" << "QWebEngineNewWindowRequest.InNewWindow --> DestinationType" - << "QQuickWebEngineNewViewRequest.openIn(QQuickWebEngineView*) --> void" + << "QQuickWebEngineNewWindowRequest.openIn(QQuickWebEngineView*) --> void" << "QQuickWebEngineProfile.AllowPersistentCookies --> PersistentCookiesPolicy" << "QQuickWebEngineProfile.DiskHttpCache --> HttpCacheType" << "QQuickWebEngineProfile.ForcePersistentCookies --> PersistentCookiesPolicy" @@ -715,7 +715,7 @@ static const QStringList expectedAPI = QStringList() << "QQuickWebEngineView.loading --> bool" << "QQuickWebEngineView.loadingChanged(QWebEngineLoadingInfo) --> void" << "QQuickWebEngineView.navigationRequested(QWebEngineNavigationRequest*) --> void" - << "QQuickWebEngineView.newViewRequested(QQuickWebEngineNewViewRequest*) --> void" + << "QQuickWebEngineView.newWindowRequested(QQuickWebEngineNewWindowRequest*) --> void" << "QQuickWebEngineView.pdfPrintingFinished(QString,bool) --> void" << "QQuickWebEngineView.printRequested() --> void" << "QQuickWebEngineView.printToPdf(QJSValue) --> void" @@ -764,7 +764,7 @@ static const QStringList expectedAPI = QStringList() << "QQuickWebEngineView.windowCloseRequested() --> void" << "QQuickWebEngineView.zoomFactor --> double" << "QQuickWebEngineView.zoomFactorChanged(double) --> void" - << "QQuickWebEngineView.acceptAsNewView(QWebEngineNewWindowRequest*) --> void" + << "QQuickWebEngineView.acceptAsNewWindow(QWebEngineNewWindowRequest*) --> void" << "QWebEngineQuotaRequest.accept() --> void" << "QWebEngineQuotaRequest.origin --> QUrl" << "QWebEngineQuotaRequest.reject() --> void" diff --git a/tests/auto/quick/qmltests/BLACKLIST b/tests/auto/quick/qmltests/BLACKLIST index f4d7d98df..8d3ffc948 100644 --- a/tests/auto/quick/qmltests/BLACKLIST +++ b/tests/auto/quick/qmltests/BLACKLIST @@ -1,4 +1,4 @@ -[NewViewRequest::test_loadNewViewRequest] +[NewWindowRequest::test_loadNewWindowRequest] macos [WebEngineViewContextMenu::test_contextMenuLinkAndSelectedText] diff --git a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml index 11a3645b6..6e1ebc92e 100644 --- a/tests/auto/quick/qmltests/data/tst_newViewRequest.qml +++ b/tests/auto/quick/qmltests/data/tst_newViewRequest.qml @@ -49,10 +49,10 @@ TestWebEngineView { SignalSpy { id: newViewRequestedSpy target: webEngineView - signalName: "newViewRequested" + signalName: "newWindowRequested" } - onNewViewRequested: function(request) { + onNewWindowRequested: function(request) { newViewRequest = { "destination": request.destination, "userInitiated": request.userInitiated, @@ -78,7 +78,7 @@ TestWebEngineView { TestCase { id: testCase - name: "NewViewRequest" + name: "NewWindowRequest" when: windowShown function init() { @@ -96,7 +96,7 @@ TestWebEngineView { dialog.destroy(); } - function test_loadNewViewRequest_data() { + function test_loadNewWindowRequest_data() { return [ { tag: "dialog", viewType: "dialog" }, { tag: "invalid", viewType: "null" }, @@ -105,7 +105,7 @@ TestWebEngineView { ]; } - function test_loadNewViewRequest(row) { + function test_loadNewWindowRequest(row) { viewType = row.viewType; var url = 'data:text/html,%3Chtml%3E%3Cbody%3ETest+Page%3C%2Fbody%3E%3C%2Fhtml%3E'; @@ -118,7 +118,7 @@ TestWebEngineView { verify(webEngineView.waitForLoadSucceeded()); tryCompare(newViewRequestedSpy, "count", 1); - compare(newViewRequest.destination, WebEngineNewViewRequest.InNewTab); + compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewTab); verify(!newViewRequest.userInitiated); if (viewType === "dialog") { @@ -139,7 +139,7 @@ TestWebEngineView { verify(webEngineView.waitForLoadSucceeded()); tryCompare(newViewRequestedSpy, "count", 1); - compare(newViewRequest.destination, WebEngineNewViewRequest.InNewDialog); + compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewDialog); compare(newViewRequest.requestedUrl, url); verify(!newViewRequest.userInitiated); if (viewType === "dialog") { @@ -163,7 +163,7 @@ TestWebEngineView { tryCompare(newViewRequestedSpy, "count", 1); compare(newViewRequest.requestedUrl, url); - compare(newViewRequest.destination, WebEngineNewViewRequest.InNewDialog); + compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewDialog); verify(newViewRequest.userInitiated); if (viewType === "dialog") { tryVerify(dialog.webEngineView.loadSucceeded) @@ -180,7 +180,7 @@ TestWebEngineView { mouseClick(webEngineView, center.x, center.y, Qt.LeftButton, Qt.ControlModifier); tryCompare(newViewRequestedSpy, "count", 1); compare(newViewRequest.requestedUrl, Qt.resolvedUrl("test1.html")); - compare(newViewRequest.destination, WebEngineNewViewRequest.InNewBackgroundTab); + compare(newViewRequest.destination, WebEngineNewWindowRequest.InNewBackgroundTab); verify(newViewRequest.userInitiated); if (viewType === "" || viewType === "null") { compare(loadRequestArray[0].status, WebEngineView.LoadStartedStatus); diff --git a/tests/auto/quick/qmltests/data/tst_viewSource.qml b/tests/auto/quick/qmltests/data/tst_viewSource.qml index 8097758fd..38d163d0c 100644 --- a/tests/auto/quick/qmltests/data/tst_viewSource.qml +++ b/tests/auto/quick/qmltests/data/tst_viewSource.qml @@ -46,7 +46,7 @@ TestWebEngineView { SignalSpy { id: newViewRequestedSpy target: webEngineView - signalName: "newViewRequested" + signalName: "newWindowRequested" } SignalSpy { @@ -55,13 +55,13 @@ TestWebEngineView { signalName: "titleChanged" } - onNewViewRequested: { + onNewWindowRequested: { viewRequest = { "destination": request.destination, "userInitiated": request.userInitiated }; - webEngineView.acceptAsNewView(request); + webEngineView.acceptAsNewWindow(request); } TestCase { @@ -93,7 +93,7 @@ TestWebEngineView { // The first titleChanged signal is emitted by adoptWebContents() tryVerify(function() { return titleChangedSpy.count >= 2; }); - compare(viewRequest.destination, WebEngineNewViewRequest.InNewTab); + compare(viewRequest.destination, WebEngineNewWindowRequest.InNewTab); verify(viewRequest.userInitiated); verify(!webEngineView.action(WebEngineView.ViewSource).enabled); @@ -122,7 +122,7 @@ TestWebEngineView { // The first titleChanged signal is emitted by adoptWebContents() tryVerify(function() { return titleChangedSpy.count >= 2; }); - compare(viewRequest.destination, WebEngineNewViewRequest.InNewTab); + compare(viewRequest.destination, WebEngineNewWindowRequest.InNewTab); verify(viewRequest.userInitiated); tryCompare(webEngineView, "url", "view-source:" + url.replace("user:passwd@", "")); diff --git a/tests/quicktestbrowser/BrowserWindow.qml b/tests/quicktestbrowser/BrowserWindow.qml index 2c4972366..128674f02 100644 --- a/tests/quicktestbrowser/BrowserWindow.qml +++ b/tests/quicktestbrowser/BrowserWindow.qml @@ -362,7 +362,7 @@ ApplicationWindow { } } - onNewViewRequested: { + onNewWindowRequested: { if (!request.userInitiated) print("Warning: Blocked a popup window.") else if (request.destination == WebEngineView.NewViewInTab) { |