summaryrefslogtreecommitdiffstats
path: root/src/core/web_contents_adapter.cpp
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-08-13 16:52:51 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2014-08-15 11:14:28 +0200
commitbf4064cda667ca64b323223d3adada43f5c8413e (patch)
treed2c6af22dfb1bf64b91db8e4e1b2e99463064adb /src/core/web_contents_adapter.cpp
parent423b399a3336ed5832ac12fe0bb9c4c3eebc1c82 (diff)
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 <andras.becsi@digia.com>
Diffstat (limited to 'src/core/web_contents_adapter.cpp')
-rw-r--r--src/core/web_contents_adapter.cpp18
1 files changed, 5 insertions, 13 deletions
diff --git a/src/core/web_contents_adapter.cpp b/src/core/web_contents_adapter.cpp
index c765c31ab..d2eb076d6 100644
--- a/src/core/web_contents_adapter.cpp
+++ b/src/core/web_contents_adapter.cpp
@@ -44,6 +44,7 @@
// found in the LICENSE file.
#include "web_contents_adapter.h"
+#include "web_contents_adapter_p.h"
#include "browser_context_qt.h"
#include "content_browser_client_qt.h"
@@ -52,7 +53,6 @@
#include "qt_render_view_observer_host.h"
#include "type_conversion.h"
#include "web_contents_adapter_client.h"
-#include "web_contents_delegate_qt.h"
#include "web_contents_view_qt.h"
#include "web_engine_context.h"
#include "web_engine_settings.h"
@@ -297,18 +297,6 @@ void deserializeNavigationHistory(QDataStream &input, int *currentIndex, std::ve
}
}
-class WebContentsAdapterPrivate {
-public:
- WebContentsAdapterPrivate();
- scoped_refptr<WebEngineContext> engineContext;
- scoped_ptr<content::WebContents> webContents;
- scoped_ptr<WebContentsDelegateQt> webContentsDelegate;
- scoped_ptr<QtRenderViewObserverHost> renderViewObserverHost;
- WebContentsAdapterClient *adapterClient;
- quint64 nextRequestId;
- int lastFindRequestId;
-};
-
WebContentsAdapterPrivate::WebContentsAdapterPrivate()
// This has to be the first thing we create, and the last we destroy.
: engineContext(WebEngineContext::current())
@@ -317,6 +305,10 @@ WebContentsAdapterPrivate::WebContentsAdapterPrivate()
{
}
+WebContentsAdapterPrivate::~WebContentsAdapterPrivate()
+{
+}
+
QExplicitlySharedDataPointer<WebContentsAdapter> WebContentsAdapter::createFromSerializedNavigationHistory(QDataStream &input, WebContentsAdapterClient *adapterClient)
{
int currentIndex;