From bf4064cda667ca64b323223d3adada43f5c8413e Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Wed, 13 Aug 2014 16:52:51 +0200 Subject: Handle new window/tab modifiers also on normal navigations AddNewContents is only called when window.open is called from JavaScript. We also want the shift/ctrl modifiers to trigger normal links to open in the requested disposition. In this case OpenURLFromTab will pass the detected disposition and we must create a new WebContents ourselves. Use the same code path going through WebContentsAdapterClient::adoptNewWindow except that we pass a null WebContents pointer to the WebContentsAdapter constructor and let it create its own when initialized. Change-Id: I817b0e72aec12723bf92d9b7ad85c1cecbf5e408 Reviewed-by: Andras Becsi --- examples/webenginewidgets/browser/webview.cpp | 2 -- 1 file changed, 2 deletions(-) (limited to 'examples/webenginewidgets/browser') diff --git a/examples/webenginewidgets/browser/webview.cpp b/examples/webenginewidgets/browser/webview.cpp index d4dd2649c..e32ab71d6 100644 --- a/examples/webenginewidgets/browser/webview.cpp +++ b/examples/webenginewidgets/browser/webview.cpp @@ -177,8 +177,6 @@ private: QWebEnginePage *WebPage::createWindow(QWebEnginePage::WebWindowType type) { - if (m_keyboardModifiers & Qt::ControlModifier || m_pressedButtons == Qt::MidButton) - m_openInNewTab = true; if (m_openInNewTab || type == QWebEnginePage::WebBrowserTab) { m_openInNewTab = false; return mainWindow()->tabWidget()->newTab()->page(); -- cgit v1.2.3