From fb612f3d2b181742730e18ca15c0944af0b743c5 Mon Sep 17 00:00:00 2001 From: Szabolcs David Date: Mon, 1 Dec 2014 04:34:04 -0800 Subject: Move newViewRequested to the public API This moves the API to public, with proper versioning, adds documentation and adjust the warning to also report an null parameter to openIn that would cause the load to fail. The experimental example code is copied from quicktestbrowser to quicknanobrowser. Change-Id: I23b06c7a5add0323d0540a783873584438d85ea8 Reviewed-by: Szabolcs David Reviewed-by: Andras Becsi --- tests/quicktestbrowser/BrowserWindow.qml | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'tests') diff --git a/tests/quicktestbrowser/BrowserWindow.qml b/tests/quicktestbrowser/BrowserWindow.qml index 98156eeb4..7516d0a65 100644 --- a/tests/quicktestbrowser/BrowserWindow.qml +++ b/tests/quicktestbrowser/BrowserWindow.qml @@ -355,6 +355,21 @@ ApplicationWindow { } ] + onNewViewRequested: { + if (!request.userInitiated) + print("Warning: Blocked a popup window.") + else if (request.destination == WebEngineView.NewViewInTab) { + var tab = tabs.createEmptyTab() + request.openIn(tab.item.webView) + } else if (request.destination == WebEngineView.NewViewInDialog) { + var dialog = applicationRoot.createDialog() + request.openIn(dialog.currentWebView) + } else { + var window = applicationRoot.createWindow() + request.openIn(window.currentWebView) + } + } + experimental { isFullScreen: webEngineView.state == "FullScreen" && browserWindow.isFullScreen onFullScreenRequested: { @@ -367,20 +382,6 @@ ApplicationWindow { } } - onNewViewRequested: { - if (!request.userInitiated) - print("Warning: Blocked a popup window.") - else if (request.destination == WebEngineView.NewViewInTab) { - var tab = tabs.createEmptyTab() - request.openIn(tab.item.webView) - } else if (request.destination == WebEngineView.NewViewInDialog) { - var dialog = applicationRoot.createDialog() - request.openIn(dialog.currentWebView) - } else { - var window = applicationRoot.createWindow() - request.openIn(window.currentWebView) - } - } onFeaturePermissionRequested: { permBar.securityOrigin = securityOrigin; permBar.requestedFeature = feature; -- cgit v1.2.3