[Qt] [WK2] Provide API for intercept (and possible ignore) links clicked in QDesktopW...
authorcaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2011 19:15:05 +0000 (19:15 +0000)
committercaio.oliveira@openbossa.org <caio.oliveira@openbossa.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 19 Aug 2011 19:15:05 +0000 (19:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=65920

Reviewed by Benjamin Poulain.

This patch makes QDesktopWebView delegate the decision of whether a navigation
should proceed to a slot in QML. The user of the DesktopWebView must implement a
'navigationPolicyForUrl()' if it wants to use the feature.

Such feature is useful for implementing opening links in "new tab" by using a
specific mouse button or mouse button plus keyboard modifiers.

The patch introduces a internal Qt-level interface called PolicyInterface, that
is used by QtWebPageProxy to delegate policy calls. A concrete implementation is
provided for QDesktopWebView.

* Shared/qt/WebCoreArgumentCodersQt.cpp:
(CoreIPC::::encode):
(CoreIPC::::decode):
Implement the serialization of the Request URL, which is the only data
we exposing from the Request.

* WebKit2.pro:
* UIProcess/qt/PolicyInterface.h: Added.
* UIProcess/qt/QtWebPageProxy.cpp:
(QtWebPageProxy::QtWebPageProxy):
(QtWebPageProxy::init):
* UIProcess/qt/QtWebPageProxy.h:
Register a Policy Client in the WK2 C API only if there's a PolicyInterface available.

* UIProcess/qt/ClientImpl.h:
* UIProcess/qt/ClientImpl.cpp:
(toPolicyInterface):
(toQtMouseButton):
(toQtKeyboardModifiers):
(qt_wk_decidePolicyForNavigationAction):
Implement the callback for the Page Policy Client. It will translate the
arguments to Qt jargon and call PolicyInterface.

* UIProcess/qt/qdesktopwebpageproxy.cpp:
(QDesktopWebPageProxy::QDesktopWebPageProxy):
* UIProcess/API/qt/qdesktopwebview.h:
* UIProcess/API/qt/qdesktopwebview_p.h:
* UIProcess/API/qt/qdesktopwebview.cpp:
(toPolicyAction):
(hasMetaMethod):
(QDesktopWebViewPrivate::navigationPolicyForURL):
The concrete implementation for QDesktopWebView. Its private object implements
the PolicyInterface and try to call a possible function defined in QML (so return
value and arguments all QVariants). If there's no such a function, returns the
default UsePolicy, like if we haven't registered a PolicyClient in WK2 C API.

* UIProcess/API/qt/tests/qmltests/DesktopWebView/tst_navigationPolicyForUrl.qml: Added.
* UIProcess/API/qt/tests/qmltests/common/test2.html: Added.
* UIProcess/API/qt/tests/qmltests/qmltests.pro:
Add a test for DesktopWebView QML element making use of a button and a modifier to
ignore a navigation.

* UIProcess/qt/qtouchwebpageproxy.cpp:
(QTouchWebPageProxy::QTouchWebPageProxy):
For now, we don't have a PolicyInterface for QTouchWebView.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@93427 268f45cc-cd09-0410-ab3c-d52691b4dbfc

16 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/qt/WebCoreArgumentCodersQt.cpp
Source/WebKit2/UIProcess/API/qt/qdesktopwebview.cpp
Source/WebKit2/UIProcess/API/qt/qdesktopwebview.h
Source/WebKit2/UIProcess/API/qt/qdesktopwebview_p.h
Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopWebView/tst_navigationPolicyForUrl.qml [new file with mode: 0644]
Source/WebKit2/UIProcess/API/qt/tests/qmltests/common/test2.html [new file with mode: 0644]
Source/WebKit2/UIProcess/API/qt/tests/qmltests/qmltests.pro
Source/WebKit2/UIProcess/qt/ClientImpl.cpp
Source/WebKit2/UIProcess/qt/ClientImpl.h
Source/WebKit2/UIProcess/qt/PolicyInterface.h [new file with mode: 0644]
Source/WebKit2/UIProcess/qt/QtWebPageProxy.cpp
Source/WebKit2/UIProcess/qt/QtWebPageProxy.h
Source/WebKit2/UIProcess/qt/qdesktopwebpageproxy.cpp
Source/WebKit2/UIProcess/qt/qtouchwebpageproxy.cpp
Source/WebKit2/WebKit2.pro

index c1cc978..52e2281 100644 (file)
@@ -1,3 +1,67 @@
+2011-08-19  Caio Marcelo de Oliveira Filho  <caio.oliveira@openbossa.org>
+
+        [Qt] [WK2] Provide API for intercept (and possible ignore) links clicked in QDesktopWebView
+        https://bugs.webkit.org/show_bug.cgi?id=65920
+
+        Reviewed by Benjamin Poulain.
+
+        This patch makes QDesktopWebView delegate the decision of whether a navigation
+        should proceed to a slot in QML. The user of the DesktopWebView must implement a
+        'navigationPolicyForUrl()' if it wants to use the feature.
+
+        Such feature is useful for implementing opening links in "new tab" by using a
+        specific mouse button or mouse button plus keyboard modifiers.
+
+        The patch introduces a internal Qt-level interface called PolicyInterface, that
+        is used by QtWebPageProxy to delegate policy calls. A concrete implementation is
+        provided for QDesktopWebView.
+
+        * Shared/qt/WebCoreArgumentCodersQt.cpp:
+        (CoreIPC::::encode):
+        (CoreIPC::::decode):
+        Implement the serialization of the Request URL, which is the only data
+        we exposing from the Request.
+
+        * WebKit2.pro:
+        * UIProcess/qt/PolicyInterface.h: Added.
+        * UIProcess/qt/QtWebPageProxy.cpp:
+        (QtWebPageProxy::QtWebPageProxy):
+        (QtWebPageProxy::init):
+        * UIProcess/qt/QtWebPageProxy.h:
+        Register a Policy Client in the WK2 C API only if there's a PolicyInterface available.
+
+        * UIProcess/qt/ClientImpl.h:
+        * UIProcess/qt/ClientImpl.cpp:
+        (toPolicyInterface):
+        (toQtMouseButton):
+        (toQtKeyboardModifiers):
+        (qt_wk_decidePolicyForNavigationAction):
+        Implement the callback for the Page Policy Client. It will translate the
+        arguments to Qt jargon and call PolicyInterface.
+
+        * UIProcess/qt/qdesktopwebpageproxy.cpp:
+        (QDesktopWebPageProxy::QDesktopWebPageProxy):
+        * UIProcess/API/qt/qdesktopwebview.h:
+        * UIProcess/API/qt/qdesktopwebview_p.h:
+        * UIProcess/API/qt/qdesktopwebview.cpp:
+        (toPolicyAction):
+        (hasMetaMethod):
+        (QDesktopWebViewPrivate::navigationPolicyForURL):
+        The concrete implementation for QDesktopWebView. Its private object implements
+        the PolicyInterface and try to call a possible function defined in QML (so return
+        value and arguments all QVariants). If there's no such a function, returns the
+        default UsePolicy, like if we haven't registered a PolicyClient in WK2 C API.
+
+        * UIProcess/API/qt/tests/qmltests/DesktopWebView/tst_navigationPolicyForUrl.qml: Added.
+        * UIProcess/API/qt/tests/qmltests/common/test2.html: Added.
+        * UIProcess/API/qt/tests/qmltests/qmltests.pro:
+        Add a test for DesktopWebView QML element making use of a button and a modifier to
+        ignore a navigation.
+
+        * UIProcess/qt/qtouchwebpageproxy.cpp:
+        (QTouchWebPageProxy::QTouchWebPageProxy):
+        For now, we don't have a PolicyInterface for QTouchWebView.
+
 2011-08-18  Anders Carlsson  <andersca@apple.com>
 
         WebProcess crashes during startup if libdispatch is initialized by WebProcessShim.dylib
index 0084bbe..23f99e9 100644 (file)
@@ -37,16 +37,21 @@ namespace CoreIPC {
 
 void ArgumentCoder<ResourceRequest>::encode(ArgumentEncoder* encoder, const ResourceRequest& resourceRequest)
 {
-    notImplemented();
+    encoder->encode(resourceRequest.url().string());
 }
 
 bool ArgumentCoder<ResourceRequest>::decode(ArgumentDecoder* decoder, ResourceRequest& resourceRequest)
 {
-    notImplemented();
-
-    // FIXME: Add real implementation when we want to implement something that
+    // FIXME: Add *more* coding implementation when we want to implement something that
     // depends on this like the policy client.
-    resourceRequest = WebCore::ResourceRequest();
+
+    ResourceRequest request;
+    String url;
+    if (!decoder->decode(url))
+        return false;
+    request.setURL(KURL(WebCore::ParsedURLString, url));
+
+    resourceRequest = request;
     return true;
 }
 
index adce836..711c683 100644 (file)
@@ -381,4 +381,44 @@ void QDesktopWebViewPrivate::didRelaunchProcess()
     q->update();
 }
 
+static PolicyInterface::PolicyAction toPolicyAction(QDesktopWebView::NavigationPolicy policy)
+{
+    switch (policy) {
+    case QDesktopWebView::UsePolicy:
+        return PolicyInterface::Use;
+    case QDesktopWebView::DownloadPolicy:
+        return PolicyInterface::Download;
+    case QDesktopWebView::IgnorePolicy:
+        return PolicyInterface::Ignore;
+    }
+    ASSERT_NOT_REACHED();
+    return PolicyInterface::Ignore;
+}
+
+static bool hasMetaMethod(QObject* object, const char* methodName)
+{
+    int methodIndex = object->metaObject()->indexOfMethod(QMetaObject::normalizedSignature(methodName));
+    return methodIndex >= 0 && methodIndex < object->metaObject()->methodCount();
+}
+
+/*!
+    \qmlmethod NavigationPolicy DesktopWebView::navigationPolicyForUrl(url, button, modifiers)
+
+    This method should be implemented by the user of DesktopWebView element.
+
+    It will be called to decide the policy for a navigation: whether the WebView should ignore the navigation,
+    continue it or start a download. The return value must be one of the policies in the NavigationPolicy enumeration.
+*/
+PolicyInterface::PolicyAction QDesktopWebViewPrivate::navigationPolicyForURL(const QUrl& url, Qt::MouseButton button, Qt::KeyboardModifiers modifiers)
+{
+    // We need to check this first because invokeMethod() warns if the method doesn't exist for the object.
+    if (!hasMetaMethod(q, "navigationPolicyForUrl(QVariant,QVariant,QVariant)"))
+        return PolicyInterface::Use;
+
+    QVariant ret;
+    if (QMetaObject::invokeMethod(q, "navigationPolicyForUrl", Q_RETURN_ARG(QVariant, ret), Q_ARG(QVariant, url), Q_ARG(QVariant, button), Q_ARG(QVariant, QVariant(modifiers))))
+        return toPolicyAction(static_cast<QDesktopWebView::NavigationPolicy>(ret.toInt()));
+    return PolicyInterface::Use;
+}
+
 #include "moc_qdesktopwebview.cpp"
index 590fabd..034c216 100644 (file)
@@ -54,8 +54,15 @@ class QWEBKIT_EXPORT QDesktopWebView : public QSGPaintedItem {
     Q_PROPERTY(QUrl url READ url NOTIFY urlChanged)
     Q_PROPERTY(int loadProgress READ loadProgress NOTIFY loadProgressChanged)
     Q_PROPERTY(QWebNavigationController* navigation READ navigationController CONSTANT)
+    Q_ENUMS(NavigationPolicy)
 
 public:
+    enum NavigationPolicy {
+        UsePolicy,
+        DownloadPolicy,
+        IgnorePolicy
+    };
+
     QDesktopWebView(QSGItem* parent = 0);
     virtual ~QDesktopWebView();
 
@@ -111,4 +118,7 @@ private:
     friend class QDesktopWebViewPrivate;
     QDesktopWebViewPrivate *d;
 };
+
+Q_DECLARE_METATYPE(QDesktopWebView::NavigationPolicy)
+
 #endif /* qdesktopwebview_h */
index 8ab6256..4a07a58 100644 (file)
@@ -27,7 +27,7 @@
 
 class QDesktopWebView;
 
-class QDesktopWebViewPrivate : public WebKit::ViewInterface
+class QDesktopWebViewPrivate : public WebKit::ViewInterface, public WebKit::PolicyInterface
 {
 public:
     QDesktopWebViewPrivate(QDesktopWebView*, WKContextRef = 0, WKPageGroupRef = 0);
@@ -72,6 +72,9 @@ private:
     virtual void processDidCrash();
     virtual void didRelaunchProcess();
 
+    // PolicyInterface.
+    virtual PolicyInterface::PolicyAction navigationPolicyForURL(const QUrl&, Qt::MouseButton, Qt::KeyboardModifiers);
+
     QSharedPointer<QMenu> activeMenu;
 };
 
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopWebView/tst_navigationPolicyForUrl.qml b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/DesktopWebView/tst_navigationPolicyForUrl.qml
new file mode 100644 (file)
index 0000000..c999b57
--- /dev/null
@@ -0,0 +1,63 @@
+import QtQuick 2.0
+import QtTest 1.0
+import QtWebKit.experimental 5.0
+
+Item {
+    DesktopWebView {
+        id: webView
+        width: 200
+        height: 200
+        function navigationPolicyForUrl(url, button, modifiers) {
+            if (button == Qt.MiddleButton && modifiers & Qt.ControlModifier) {
+                otherWebView.load(url)
+                return DesktopWebView.IgnorePolicy
+            }
+            return DesktopWebView.UsePolicy
+        }
+    }
+
+    SignalSpy {
+        id: spy
+        target: webView
+        signalName: "loadSucceeded"
+    }
+
+    DesktopWebView {
+        id: otherWebView
+    }
+
+    SignalSpy {
+        id: otherSpy
+        target: otherWebView
+        signalName: "loadSucceeded"
+    }
+
+    TestCase {
+        name: "DesktopWebViewNavigationPolicyForUrl"
+        when: windowShown
+
+        function test_usePolicy() {
+            webView.load(Qt.resolvedUrl("../common/test2.html"))
+            spy.wait()
+            spy.clear()
+            compare(spy.count, 0)
+            mouseClick(webView, 100, 100, Qt.LeftButton)
+            spy.wait()
+            compare(spy.count, 1)
+            compare(webView.title, "Test page 1")
+        }
+
+        function test_ignorePolicy() {
+            webView.load(Qt.resolvedUrl("../common/test2.html"))
+            spy.wait()
+            spy.clear()
+            compare(spy.count, 0)
+            compare(otherSpy.count, 0)
+            mouseClick(webView, 100, 100, Qt.MiddleButton, Qt.ControlModifier)
+            otherSpy.wait()
+            compare(spy.count, 0)
+            compare(otherSpy.count, 1)
+            compare(otherWebView.title, "Test page 1")
+        }
+    }
+}
diff --git a/Source/WebKit2/UIProcess/API/qt/tests/qmltests/common/test2.html b/Source/WebKit2/UIProcess/API/qt/tests/qmltests/common/test2.html
new file mode 100644 (file)
index 0000000..0a3c39d
--- /dev/null
@@ -0,0 +1,6 @@
+<html>
+<head><title>Test page with huge link area</title></head>
+<body>
+<a href="test1.html"><img width=200 height=200></a>
+</body>
+</html>
index 1c301ea..b0139f5 100644 (file)
@@ -12,5 +12,6 @@ message($$PWD)
 
 OTHER_FILES += \
     DesktopWebView/tst_properties.qml \
+    DesktopWebView/tst_navigationPolicyForUrl.qml \
     TouchWebView/tst_properties.qml
 
index e9654b3..da810d3 100644 (file)
 #include "WKURLQt.h"
 #include "qweberror.h"
 #include "qweberror_p.h"
+#include <PolicyInterface.h>
 #include <qwkcontext.h>
 #include <QtWebPageProxy.h>
 #include <ViewInterface.h>
 #include <WKFrame.h>
+#include <WKFramePolicyListener.h>
 #include <WKType.h>
+#include <WKURLRequest.h>
 
 using namespace WebKit;
 
@@ -54,6 +57,12 @@ static inline ViewInterface* toViewInterface(const void* clientInfo)
     return reinterpret_cast<ViewInterface*>(const_cast<void*>(clientInfo));
 }
 
+static inline PolicyInterface* toPolicyInterface(const void* clientInfo)
+{
+    ASSERT(clientInfo);
+    return reinterpret_cast<PolicyInterface*>(const_cast<void*>(clientInfo));
+}
+
 static void dispatchLoadSucceeded(WKFrameRef frame, const void* clientInfo)
 {
     if (!WKFrameIsMainFrame(frame))
@@ -155,3 +164,51 @@ void qt_wk_didChangeIconForPageURL(WKIconDatabaseRef iconDatabase, WKURLRef page
 void qt_wk_didRemoveAllIcons(WKIconDatabaseRef iconDatabase, const void* clientInfo)
 {
 }
+
+static Qt::MouseButton toQtMouseButton(WKEventMouseButton button)
+{
+    switch (button) {
+    case kWKEventMouseButtonLeftButton:
+        return Qt::LeftButton;
+    case kWKEventMouseButtonMiddleButton:
+        return Qt::MiddleButton;
+    case kWKEventMouseButtonRightButton:
+        return Qt::RightButton;
+    }
+    return Qt::NoButton;
+}
+
+static Qt::KeyboardModifiers toQtKeyboardModifiers(WKEventModifiers modifiers)
+{
+    Qt::KeyboardModifiers qtModifiers = Qt::NoModifier;
+    if (modifiers & kWKEventModifiersShiftKey)
+        qtModifiers |= Qt::ShiftModifier;
+    if (modifiers & kWKEventModifiersControlKey)
+        qtModifiers |= Qt::ControlModifier;
+    if (modifiers & kWKEventModifiersAltKey)
+        qtModifiers |= Qt::AltModifier;
+    if (modifiers & kWKEventModifiersMetaKey)
+        qtModifiers |= Qt::MetaModifier;
+    return qtModifiers;
+}
+
+void qt_wk_decidePolicyForNavigationAction(WKPageRef page, WKFrameRef frame, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef userData, const void* clientInfo)
+{
+    PolicyInterface* policyInterface = toPolicyInterface(clientInfo);
+    WKURLRef requestURL = WKURLRequestCopyURL(request);
+    QUrl qUrl = WKURLCopyQUrl(requestURL);
+    WKRelease(requestURL);
+
+    PolicyInterface::PolicyAction action = policyInterface->navigationPolicyForURL(qUrl, toQtMouseButton(mouseButton), toQtKeyboardModifiers(modifiers));
+    switch (action) {
+    case PolicyInterface::Use:
+        WKFramePolicyListenerUse(listener);
+        break;
+    case PolicyInterface::Download:
+        WKFramePolicyListenerDownload(listener);
+        break;
+    case PolicyInterface::Ignore:
+        WKFramePolicyListenerIgnore(listener);
+        break;
+    }
+}
index 7f5d696..bfb7629 100644 (file)
@@ -45,6 +45,9 @@ void qt_wk_setStatusText(WKPageRef page, WKStringRef text, const void *clientInf
 void qt_wk_didChangeIconForPageURL(WKIconDatabaseRef, WKURLRef, const void* clientInfo);
 void qt_wk_didRemoveAllIcons(WKIconDatabaseRef, const void* clientInfo);
 
+// Policy client.
+void qt_wk_decidePolicyForNavigationAction(WKPageRef, WKFrameRef, WKFrameNavigationType, WKEventModifiers, WKEventMouseButton, WKURLRequestRef, WKFramePolicyListenerRef, WKTypeRef userData, const void* clientInfo);
+
 #ifdef __cplusplus
 }
 #endif
diff --git a/Source/WebKit2/UIProcess/qt/PolicyInterface.h b/Source/WebKit2/UIProcess/qt/PolicyInterface.h
new file mode 100644 (file)
index 0000000..dc0b47a
--- /dev/null
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies)
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Library General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * Library General Public License for more details.
+ *
+ * You should have received a copy of the GNU Library General Public License
+ * along with this program; see the file COPYING.LIB.  If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ */
+
+#ifndef PolicyInterface_h
+#define PolicyInterface_h
+
+#include <QtCore/QUrl>
+
+namespace WebKit {
+
+class PolicyInterface {
+public:
+    enum PolicyAction {
+        Use,
+        Download,
+        Ignore
+    };
+
+    virtual PolicyAction navigationPolicyForURL(const QUrl&, Qt::MouseButton, Qt::KeyboardModifiers) = 0;
+};
+
+}
+
+#endif /* PolicyInterface_h */
index 77777f6..ddaa4d6 100644 (file)
@@ -33,6 +33,7 @@
 #include "LocalizedStrings.h"
 #include "NativeWebKeyboardEvent.h"
 #include "NotImplemented.h"
+#include "PolicyInterface.h"
 #include "WebBackForwardList.h"
 #include "WebContext.h"
 #include "WebContextMenuProxyQt.h"
@@ -94,8 +95,9 @@ WebCore::DragOperation dropActionToDragOperation(Qt::DropActions actions)
     return (DragOperation)result;
 }
 
-QtWebPageProxy::QtWebPageProxy(ViewInterface* viewInterface, QWKContext* c, WKPageGroupRef pageGroupRef)
+QtWebPageProxy::QtWebPageProxy(ViewInterface* viewInterface, PolicyInterface* policyInterface, QWKContext* c, WKPageGroupRef pageGroupRef)
     : m_viewInterface(viewInterface)
+    , m_policyInterface(policyInterface)
     , m_context(c)
     , m_preferences(0)
     , m_undoStack(adoptPtr(new QUndoStack(this)))
@@ -185,6 +187,18 @@ void QtWebPageProxy::init()
         0,  /* shouldInterruptJavaScript */
     };
     WKPageSetPageUIClient(toAPI(m_webPageProxy.get()), &uiClient);
+
+    if (m_policyInterface) {
+        WKPagePolicyClient policyClient = {
+            0,
+            m_policyInterface,
+            qt_wk_decidePolicyForNavigationAction,
+            0,  /* decidePolicyForNewWindowAction */
+            0,  /* decidePolicyForResponse */
+            0,  /* unableToImplementPolicy */
+        };
+        WKPageSetPagePolicyClient(toAPI(m_webPageProxy.get()), &policyClient);
+    }
 }
 
 QtWebPageProxy::~QtWebPageProxy()
index 0580428..4bc5ca6 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "LayerTreeContext.h"
 #include "PageClient.h"
+#include "PolicyInterface.h"
 #include "qwebkittypes.h"
 #include "ShareableBitmap.h"
 #include "ViewportArguments.h"
@@ -70,7 +71,7 @@ public:
         WebActionCount
     };
 
-    QtWebPageProxy(WebKit::ViewInterface* viewInterface, QWKContext*, WKPageGroupRef = 0);
+    QtWebPageProxy(WebKit::ViewInterface*, WebKit::PolicyInterface*, QWKContext*, WKPageGroupRef = 0);
     ~QtWebPageProxy();
 
     virtual bool handleEvent(QEvent*);
@@ -187,6 +188,7 @@ protected:
     virtual void paintContent(QPainter* painter, const QRect& area) = 0;
     RefPtr<WebKit::WebPageProxy> m_webPageProxy;
     WebKit::ViewInterface* const m_viewInterface;
+    WebKit::PolicyInterface* const m_policyInterface;
 
 private:
     bool handleKeyPressEvent(QKeyEvent*);
index 7ae87b1..5fcfedd 100644 (file)
@@ -47,8 +47,8 @@ static inline Qt::DropAction dragOperationToDropAction(unsigned dragOperation)
     return result;
 }
 
-QDesktopWebPageProxy::QDesktopWebPageProxy(QDesktopWebViewPrivate* viewInterface, QWKContext* context, WKPageGroupRef pageGroup)
-    : QtWebPageProxy(viewInterface, context, pageGroup)
+QDesktopWebPageProxy::QDesktopWebPageProxy(QDesktopWebViewPrivate* desktopWebView, QWKContext* context, WKPageGroupRef pageGroup)
+    : QtWebPageProxy(desktopWebView, desktopWebView, context, pageGroup)
 {
     init();
 }
index a21ccbf..922c10a 100644 (file)
@@ -28,7 +28,7 @@
 using namespace WebCore;
 
 QTouchWebPageProxy::QTouchWebPageProxy(TouchViewInterface* viewInterface, ViewportInteractionEngine* viewportInteractionEngine, QWKContext* context, WKPageGroupRef pageGroupRef)
-    : QtWebPageProxy(viewInterface, context, pageGroupRef)
+    : QtWebPageProxy(viewInterface, 0, context, pageGroupRef)
     , m_panGestureRecognizer(viewportInteractionEngine)
     , m_pinchGestureRecognizer(viewportInteractionEngine)
 {
index 5cc2050..e4ce17a 100644 (file)
@@ -237,6 +237,7 @@ HEADERS += \
     UIProcess/WebUIClient.h \
     UIProcess/qt/ClientImpl.h \
     UIProcess/qt/TouchViewInterface.h \
+    UIProcess/qt/PolicyInterface.h \
     UIProcess/qt/QtGestureRecognizer.h \
     UIProcess/qt/QtPanGestureRecognizer.h \
     UIProcess/qt/QtPinchGestureRecognizer.h \