[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

weinig at apple.com weinig at apple.com
Wed Dec 22 12:05:04 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit 7b17ad9c5de95e0236e7575b230de9f31a6a9be3
Author: weinig at apple.com <weinig at apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Aug 13 20:11:17 2010 +0000

    Add form submission listener to WebKit2
    Part of <rdar://problem/8255932>
    https://bugs.webkit.org/show_bug.cgi?id=43947
    
    Reviewed by Jon Honeycutt.
    
    * Shared/APIObject.h:
    Add TypeFormSubmissionListener APIType.
    
    * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
    Add WillSubmitForm message kind.
    
    * UIProcess/API/C/WKAPICast.h:
    Add new mappings for WKFormSubmissionListenerRef -> WebFormSubmissionListener
    
    * UIProcess/API/C/WKBase.h:
    Add OpaqueWKFormSubmissionListener and rename the other opaque types to match.
    
    * UIProcess/API/C/WKFormSubmissionListener.cpp: Added.
    (WKFormSubmissionListenerGetTypeID):
    (WKFormSubmissionListenerContinue):
    (WKFormSubmissionListenerRetain):
    (WKFormSubmissionListenerRelease):
    * UIProcess/API/C/WKFormSubmissionListener.h: Added.
    Add C wrapper for WebFormSubmissionListener.
    
    * UIProcess/API/C/WKPage.cpp:
    (WKPageSetPageFormClient):
    * UIProcess/API/C/WKPage.h:
    Add WKPageFormClient with willSubmitForm callback. Additional callbacks will be added as
    needed.
    
    * UIProcess/API/C/WebKit2.h:
    Add include for WKFormSubmissionListener.h
    
    * UIProcess/WebFormClient.cpp: Added.
    (WebKit::WebFormClient::WebFormClient):
    (WebKit::WebFormClient::initialize):
    (WebKit::WebFormClient::willSubmitForm):
    * UIProcess/WebFormClient.h: Added.
    Add client for form related delagations.
    
    * UIProcess/WebFormSubmissionListenerProxy.cpp: Added.
    (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):
    (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
    * UIProcess/WebFormSubmissionListenerProxy.h: Added.
    (WebKit::WebFormSubmissionListenerProxy::create):
    (WebKit::WebFormSubmissionListenerProxy::type):
    * UIProcess/WebFrameListenerProxy.cpp: Copied from UIProcess/WebFramePolicyListenerProxy.cpp.
    Add new type of listener for form submissions. It inherits from the new base class
    for listeners, WebFrameListenerProxy.
    
    (WebKit::WebFrameListenerProxy::WebFrameListenerProxy):
    (WebKit::WebFrameListenerProxy::~WebFrameListenerProxy):
    (WebKit::WebFrameListenerProxy::invalidate):
    (WebKit::WebFrameListenerProxy::receivedPolicyDecision):
    * UIProcess/WebFrameListenerProxy.h: Copied from UIProcess/WebFramePolicyListenerProxy.h.
    Move logic that would have to be shared between WebFramePolicyListenerProxy and
    WebFormSubmissionListenerProxy into shared base class.
    
    * UIProcess/WebFramePolicyListenerProxy.cpp:
    (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
    * UIProcess/WebFramePolicyListenerProxy.h:
    (WebKit::WebFramePolicyListenerProxy::create):
    (WebKit::WebFramePolicyListenerProxy::type):
    Move to inheriting from WebFrameListenerProxy.
    
    * UIProcess/WebFrameProxy.cpp:
    (WebKit::WebFrameProxy::disconnect):
    (WebKit::WebFrameProxy::receivedPolicyDecision):
    (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
    (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy):
    * UIProcess/WebFrameProxy.h:
    Change listener functions to act on WebFrameListenerProxys and add setUpFormSubmissionListenerProxy.
    
    * UIProcess/WebPageProxy.cpp:
    (WebKit::WebPageProxy::initializeFormClient):
    (WebKit::WebPageProxy::didReceiveMessage):
    (WebKit::WebPageProxy::willSubmitForm):
    * UIProcess/WebPageProxy.h:
    Plumb through willSubmitForm call as we do with the other listeners.
    
    * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
    (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
    Ditto.
    
    * WebKit2.xcodeproj/project.pbxproj: Add new files.
    * win/WebKit2.vcproj: Add new files.
    * win/WebKit2Generated.make: Ditto.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@65337 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit2/ChangeLog b/WebKit2/ChangeLog
index 80bda81..4c02636 100644
--- a/WebKit2/ChangeLog
+++ b/WebKit2/ChangeLog
@@ -1,3 +1,95 @@
+2010-08-13  Sam Weinig  <sam at webkit.org>
+
+        Reviewed by Jon Honeycutt.
+
+        Add form submission listener to WebKit2
+        Part of <rdar://problem/8255932>
+        https://bugs.webkit.org/show_bug.cgi?id=43947
+
+        * Shared/APIObject.h:
+        Add TypeFormSubmissionListener APIType.
+        
+        * Shared/CoreIPCSupport/WebPageProxyMessageKinds.h:
+        Add WillSubmitForm message kind.
+
+        * UIProcess/API/C/WKAPICast.h:
+        Add new mappings for WKFormSubmissionListenerRef -> WebFormSubmissionListener
+
+        * UIProcess/API/C/WKBase.h:
+        Add OpaqueWKFormSubmissionListener and rename the other opaque types to match.
+
+        * UIProcess/API/C/WKFormSubmissionListener.cpp: Added.
+        (WKFormSubmissionListenerGetTypeID):
+        (WKFormSubmissionListenerContinue):
+        (WKFormSubmissionListenerRetain):
+        (WKFormSubmissionListenerRelease):
+        * UIProcess/API/C/WKFormSubmissionListener.h: Added.
+        Add C wrapper for WebFormSubmissionListener.
+
+        * UIProcess/API/C/WKPage.cpp:
+        (WKPageSetPageFormClient):
+        * UIProcess/API/C/WKPage.h:
+        Add WKPageFormClient with willSubmitForm callback. Additional callbacks will be added as
+        needed.
+
+        * UIProcess/API/C/WebKit2.h:
+        Add include for WKFormSubmissionListener.h
+
+        * UIProcess/WebFormClient.cpp: Added.
+        (WebKit::WebFormClient::WebFormClient):
+        (WebKit::WebFormClient::initialize):
+        (WebKit::WebFormClient::willSubmitForm):
+        * UIProcess/WebFormClient.h: Added.
+        Add client for form related delagations.
+
+        * UIProcess/WebFormSubmissionListenerProxy.cpp: Added.
+        (WebKit::WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy):
+        (WebKit::WebFormSubmissionListenerProxy::continueSubmission):
+        * UIProcess/WebFormSubmissionListenerProxy.h: Added.
+        (WebKit::WebFormSubmissionListenerProxy::create):
+        (WebKit::WebFormSubmissionListenerProxy::type):
+        * UIProcess/WebFrameListenerProxy.cpp: Copied from UIProcess/WebFramePolicyListenerProxy.cpp.
+        Add new type of listener for form submissions. It inherits from the new base class
+        for listeners, WebFrameListenerProxy.
+
+        (WebKit::WebFrameListenerProxy::WebFrameListenerProxy):
+        (WebKit::WebFrameListenerProxy::~WebFrameListenerProxy):
+        (WebKit::WebFrameListenerProxy::invalidate):
+        (WebKit::WebFrameListenerProxy::receivedPolicyDecision):
+        * UIProcess/WebFrameListenerProxy.h: Copied from UIProcess/WebFramePolicyListenerProxy.h.
+        Move logic that would have to be shared between WebFramePolicyListenerProxy and
+        WebFormSubmissionListenerProxy into shared base class.
+
+        * UIProcess/WebFramePolicyListenerProxy.cpp:
+        (WebKit::WebFramePolicyListenerProxy::WebFramePolicyListenerProxy):
+        * UIProcess/WebFramePolicyListenerProxy.h:
+        (WebKit::WebFramePolicyListenerProxy::create):
+        (WebKit::WebFramePolicyListenerProxy::type):
+        Move to inheriting from WebFrameListenerProxy.
+
+        * UIProcess/WebFrameProxy.cpp:
+        (WebKit::WebFrameProxy::disconnect):
+        (WebKit::WebFrameProxy::receivedPolicyDecision):
+        (WebKit::WebFrameProxy::setUpPolicyListenerProxy):
+        (WebKit::WebFrameProxy::setUpFormSubmissionListenerProxy):
+        * UIProcess/WebFrameProxy.h:
+        Change listener functions to act on WebFrameListenerProxys and add setUpFormSubmissionListenerProxy.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::initializeFormClient):
+        (WebKit::WebPageProxy::didReceiveMessage):
+        (WebKit::WebPageProxy::willSubmitForm):
+        * UIProcess/WebPageProxy.h:
+        Plumb through willSubmitForm call as we do with the other listeners.
+
+        * WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp:
+        (WebKit::WebFrameLoaderClient::dispatchWillSubmitForm):
+        Ditto.
+
+        * WebKit2.xcodeproj/project.pbxproj: Add new files.
+        * win/WebKit2.vcproj: Add new files.
+        * win/WebKit2Generated.make: Ditto.
+
 2010-08-13  Gavin Barraclough  <barraclough at apple.com>
 
         Reviewed by Sam Weinig
diff --git a/WebKit2/Shared/APIObject.h b/WebKit2/Shared/APIObject.h
index eb89f5a..9cd2ff6 100644
--- a/WebKit2/Shared/APIObject.h
+++ b/WebKit2/Shared/APIObject.h
@@ -44,6 +44,7 @@ public:
         TypeBackForwardList,
         TypeBackForwardListItem,
         TypeContext,
+        TypeFormSubmissionListener,
         TypeFrame,
         TypeFramePolicyListener,
         TypeNavigationData,
diff --git a/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h b/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h
index 8869ca7..591249f 100644
--- a/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h
+++ b/WebKit2/Shared/CoreIPCSupport/WebPageProxyMessageKinds.h
@@ -64,6 +64,7 @@ enum Kind {
     SetCursor,
     SetToolTip,
     TakeFocus,
+    WillSubmitForm,
     
     BackForwardAddItem,
     BackForwardGoToItem,
diff --git a/WebKit2/UIProcess/API/C/WKAPICast.h b/WebKit2/UIProcess/API/C/WKAPICast.h
index 1451f66..3178c4c 100644
--- a/WebKit2/UIProcess/API/C/WKAPICast.h
+++ b/WebKit2/UIProcess/API/C/WKAPICast.h
@@ -44,6 +44,7 @@ class WebBackForwardListItem;
 class WebContext;
 class WebData;
 class WebError;
+class WebFormSubmissionListenerProxy;
 class WebFramePolicyListenerProxy;
 class WebFrameProxy;
 class WebNavigationData;
@@ -59,6 +60,7 @@ template<> struct APITypeInfo<WKBackForwardListItemRef>         { typedef WebBac
 template<> struct APITypeInfo<WKBackForwardListRef>             { typedef WebBackForwardList* ImplType; };
 template<> struct APITypeInfo<WKContextRef>                     { typedef WebContext* ImplType; };
 template<> struct APITypeInfo<WKDataRef>                        { typedef WebData* ImplType; };
+template<> struct APITypeInfo<WKFormSubmissionListenerRef>      { typedef WebFormSubmissionListenerProxy* ImplType; };
 template<> struct APITypeInfo<WKFramePolicyListenerRef>         { typedef WebFramePolicyListenerProxy* ImplType; };
 template<> struct APITypeInfo<WKFrameRef>                       { typedef WebFrameProxy* ImplType; };
 template<> struct APITypeInfo<WKNavigationDataRef>              { typedef WebNavigationData* ImplType; };
@@ -77,6 +79,7 @@ template<> struct ImplTypeInfo<WebBackForwardListItem*>         { typedef WKBack
 template<> struct ImplTypeInfo<WebContext*>                     { typedef WKContextRef APIType; };
 template<> struct ImplTypeInfo<WebData*>                        { typedef WKDataRef APIType; };
 template<> struct ImplTypeInfo<WebError*>                       { typedef WKErrorRef APIType; };
+template<> struct ImplTypeInfo<WebFormSubmissionListenerProxy*> { typedef WKFormSubmissionListenerRef APIType; };
 template<> struct ImplTypeInfo<WebFramePolicyListenerProxy*>    { typedef WKFramePolicyListenerRef APIType; };
 template<> struct ImplTypeInfo<WebFrameProxy*>                  { typedef WKFrameRef APIType; };
 template<> struct ImplTypeInfo<WebNavigationData*>              { typedef WKNavigationDataRef APIType; };
diff --git a/WebKit2/UIProcess/API/C/WKBase.h b/WebKit2/UIProcess/API/C/WKBase.h
index 90a17ec..c6777ef 100644
--- a/WebKit2/UIProcess/API/C/WKBase.h
+++ b/WebKit2/UIProcess/API/C/WKBase.h
@@ -35,20 +35,21 @@
 typedef uint32_t WKTypeID;
 typedef void* WKTypeRef;
 
-typedef struct OpaqueWKArrayRef* WKArrayRef;
-typedef struct OpaqueWKBackForwardListItemRef* WKBackForwardListItemRef;
-typedef struct OpaqueWKBackForwardListRef* WKBackForwardListRef;
+typedef struct OpaqueWKArray* WKArrayRef;
+typedef struct OpaqueWKBackForwardList* WKBackForwardListRef;
+typedef struct OpaqueWKBackForwardListItem* WKBackForwardListItemRef;
 typedef struct OpaqueWKContext* WKContextRef;
 typedef struct OpaqueWKData* WKDataRef;
 typedef struct OpaqueWKError* WKErrorRef;
+typedef struct OpaqueWKFormSubmissionListener* WKFormSubmissionListenerRef;
 typedef struct OpaqueWKFrame* WKFrameRef;
 typedef struct OpaqueWKFramePolicyListener* WKFramePolicyListenerRef;
-typedef struct OpaqueWKNavigationDataRef* WKNavigationDataRef;
+typedef struct OpaqueWKNavigationData* WKNavigationDataRef;
 typedef struct OpaqueWKPage* WKPageRef;
 typedef struct OpaqueWKPageNamespace* WKPageNamespaceRef;
-typedef struct OpaqueWKPreferencesRef* WKPreferencesRef;
-typedef struct OpaqueWKStringRef* WKStringRef;
-typedef struct OpaqueWKURLRef* WKURLRef;
+typedef struct OpaqueWKPreferences* WKPreferencesRef;
+typedef struct OpaqueWKString* WKStringRef;
+typedef struct OpaqueWKURL* WKURLRef;
 
 #undef WK_EXPORT
 #if defined(WK_NO_EXPORT)
diff --git a/WebKit2/UIProcess/API/C/WKFormSubmissionListener.cpp b/WebKit2/UIProcess/API/C/WKFormSubmissionListener.cpp
new file mode 100644
index 0000000..ef3de2a
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/WKFormSubmissionListener.cpp
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WKFormSubmissionListener.h"
+
+#include "WKAPICast.h"
+#include "WebFormSubmissionListenerProxy.h"
+
+using namespace WebKit;
+
+WKTypeID WKFormSubmissionListenerGetTypeID()
+{
+    return toRef(WebFormSubmissionListenerProxy::APIType);
+}
+
+void WKFormSubmissionListenerContinue(WKFormSubmissionListenerRef submissionListener)
+{
+    toWK(submissionListener)->continueSubmission();
+}
+
+WKFormSubmissionListenerRef WKFormSubmissionListenerRetain(WKFormSubmissionListenerRef submissionListenerRef)
+{
+    toWK(submissionListenerRef)->ref();
+    return submissionListenerRef;
+}
+
+void WKFormSubmissionListenerRelease(WKFormSubmissionListenerRef submissionListenerRef)
+{
+    toWK(submissionListenerRef)->deref();
+}
diff --git a/WebKit2/UIProcess/API/C/WKFormSubmissionListener.h b/WebKit2/UIProcess/API/C/WKFormSubmissionListener.h
new file mode 100644
index 0000000..7b9ea67
--- /dev/null
+++ b/WebKit2/UIProcess/API/C/WKFormSubmissionListener.h
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WKFormSubmissionListener_h
+#define WKFormSubmissionListener_h
+
+#include <WebKit2/WKBase.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT WKTypeID WKFormSubmissionListenerGetTypeID();
+
+WK_EXPORT void WKFormSubmissionListenerContinue(WKFormSubmissionListenerRef submissionListener);
+
+WK_EXPORT WKFormSubmissionListenerRef WKFormSubmissionListenerRetain(WKFormSubmissionListenerRef submissionListener);
+WK_EXPORT void WKFormSubmissionListenerRelease(WKFormSubmissionListenerRef submissionListener);
+
+#ifdef __cplusplus
+}
+#endif
+
+WK_DECLARE_RETAIN_RELEASE_OVERLOADS(WKFormSubmissionListener)
+
+#endif /* WKFormSubmissionListener_h */
diff --git a/WebKit2/UIProcess/API/C/WKPage.cpp b/WebKit2/UIProcess/API/C/WKPage.cpp
index 6369c8a..9883dfa 100644
--- a/WebKit2/UIProcess/API/C/WKPage.cpp
+++ b/WebKit2/UIProcess/API/C/WKPage.cpp
@@ -155,6 +155,12 @@ void WKPageSetPagePolicyClient(WKPageRef pageRef, const WKPagePolicyClient* wkCl
         toWK(pageRef)->initializePolicyClient(wkClient);
 }
 
+void WKPageSetPageFormClient(WKPageRef pageRef, const WKPageFormClient* wkClient)
+{
+    if (wkClient && !wkClient->version)
+        toWK(pageRef)->initializeFormClient(wkClient);
+}
+
 void WKPageSetPageUIClient(WKPageRef pageRef, const WKPageUIClient * wkClient)
 {
     if (wkClient && !wkClient->version)
diff --git a/WebKit2/UIProcess/API/C/WKPage.h b/WebKit2/UIProcess/API/C/WKPage.h
index e8bd5fd..d128d4f 100644
--- a/WebKit2/UIProcess/API/C/WKPage.h
+++ b/WebKit2/UIProcess/API/C/WKPage.h
@@ -113,6 +113,16 @@ struct WKPagePolicyClient {
 };
 typedef struct WKPagePolicyClient WKPagePolicyClient;
 
+// Form Client.
+typedef void (*WKPageWillSubmitFormCallback)(WKPageRef page, WKFrameRef frame, WKFrameRef sourceFrame, WKFormSubmissionListenerRef listener, const void* clientInfo);
+
+struct WKPageFormClient {
+    int                                                                 version;
+    const void *                                                        clientInfo;
+    WKPageWillSubmitFormCallback                                        willSubmitForm;
+};
+typedef struct WKPageFormClient WKPageFormClient;
+
 // UI Client
 typedef WKPageRef (*WKPageCreateNewPageCallback)(WKPageRef page, const void *clientInfo);
 typedef void (*WKPageShowPageCallback)(WKPageRef page, const void *clientInfo);
@@ -165,6 +175,7 @@ WK_EXPORT void WKPageRestoreFromSessionState(WKPageRef page, WKDataRef sessionSt
 
 WK_EXPORT void WKPageSetPageLoaderClient(WKPageRef page, const WKPageLoaderClient* client);
 WK_EXPORT void WKPageSetPagePolicyClient(WKPageRef page, const WKPagePolicyClient* client);
+WK_EXPORT void WKPageSetPageFormClient(WKPageRef page, const WKPageFormClient* client);
 WK_EXPORT void WKPageSetPageUIClient(WKPageRef page, const WKPageUIClient* client);
 
 typedef void (*WKPageRunJavaScriptFunction)(WKStringRef, WKErrorRef, void*);
diff --git a/WebKit2/UIProcess/API/C/WebKit2.h b/WebKit2/UIProcess/API/C/WebKit2.h
index 8a881ad..0bb796b 100644
--- a/WebKit2/UIProcess/API/C/WebKit2.h
+++ b/WebKit2/UIProcess/API/C/WebKit2.h
@@ -28,9 +28,11 @@
 
 #include <WebKit2/WKBase.h>
 #include <WebKit2/WKType.h>
+
 #include <WebKit2/WKBackForwardList.h>
 #include <WebKit2/WKBackForwardListItem.h>
 #include <WebKit2/WKContext.h>
+#include <WebKit2/WKFormSubmissionListener.h>
 #include <WebKit2/WKFrame.h>
 #include <WebKit2/WKFramePolicyListener.h>
 #include <WebKit2/WKNavigationData.h>
diff --git a/WebKit2/UIProcess/WebFormClient.cpp b/WebKit2/UIProcess/WebFormClient.cpp
new file mode 100644
index 0000000..6d5eff1
--- /dev/null
+++ b/WebKit2/UIProcess/WebFormClient.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WebFormClient.h"
+
+#include "WKAPICast.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+WebFormClient::WebFormClient()
+{
+    initialize(0);
+}
+
+void WebFormClient::initialize(const WKPageFormClient* client)
+{
+    if (client && !client->version)
+        m_pageFormClient = *client;
+    else 
+        memset(&m_pageFormClient, 0, sizeof(m_pageFormClient));
+}
+
+bool WebFormClient::willSubmitForm(WebPageProxy* page, WebFrameProxy* frame, WebFrameProxy* sourceFrame, WebFormSubmissionListenerProxy* listener)
+{
+    if (!m_pageFormClient.willSubmitForm)
+        return false;
+
+    m_pageFormClient.willSubmitForm(toRef(page), toRef(frame), toRef(sourceFrame), toRef(listener), m_pageFormClient.clientInfo);
+    return true;
+}
+
+} // namespace WebKit
diff --git a/WebKit2/UIProcess/WebFormClient.h b/WebKit2/UIProcess/WebFormClient.h
new file mode 100644
index 0000000..f5d167b
--- /dev/null
+++ b/WebKit2/UIProcess/WebFormClient.h
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFormClient_h
+#define WebFormClient_h
+
+#include "WKPage.h"
+#include <wtf/Forward.h>
+
+namespace WebKit {
+
+class WebPageProxy;
+class WebFrameProxy;
+class WebFormSubmissionListenerProxy;
+
+class WebFormClient {
+public:
+    WebFormClient();
+    void initialize(const WKPageFormClient*);
+
+    // FIXME: Add value dictionary and form element reference.
+    bool willSubmitForm(WebPageProxy*, WebFrameProxy*, WebFrameProxy*, WebFormSubmissionListenerProxy*); 
+
+private:
+    WKPageFormClient m_pageFormClient;
+};
+
+} // namespace WebKit
+
+#endif // WebFormClient_h
diff --git a/WebKit2/UIProcess/WebFormSubmissionListenerProxy.cpp b/WebKit2/UIProcess/WebFormSubmissionListenerProxy.cpp
new file mode 100644
index 0000000..10564a4
--- /dev/null
+++ b/WebKit2/UIProcess/WebFormSubmissionListenerProxy.cpp
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WebFormSubmissionListenerProxy.h"
+
+namespace WebKit {
+
+WebFormSubmissionListenerProxy::WebFormSubmissionListenerProxy(WebFrameProxy* frame, uint64_t listenerID)
+    : WebFrameListenerProxy(frame, listenerID)
+{
+}
+
+void WebFormSubmissionListenerProxy::continueSubmission()
+{
+    receivedPolicyDecision(WebCore::PolicyUse);
+}
+
+} // namespace WebKit
diff --git a/WebKit2/UIProcess/WebFormSubmissionListenerProxy.h b/WebKit2/UIProcess/WebFormSubmissionListenerProxy.h
new file mode 100644
index 0000000..53ba3b9
--- /dev/null
+++ b/WebKit2/UIProcess/WebFormSubmissionListenerProxy.h
@@ -0,0 +1,54 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFormSubmissionListenerProxy_h
+#define WebFormSubmissionListenerProxy_h
+
+#include "WebFrameListenerProxy.h"
+
+namespace WebKit {
+
+class WebFrameProxy;
+
+class WebFormSubmissionListenerProxy : public WebFrameListenerProxy {
+public:
+    static const Type APIType = TypeFormSubmissionListener;
+
+    static PassRefPtr<WebFormSubmissionListenerProxy> create(WebFrameProxy* frame, uint64_t listenerID)
+    {
+        return adoptRef(new WebFormSubmissionListenerProxy(frame, listenerID));
+    }
+
+    void continueSubmission();
+
+private:
+    WebFormSubmissionListenerProxy(WebFrameProxy*, uint64_t listenerID);
+
+    virtual Type type() const { return APIType; }
+};
+
+} // namespace WebKit
+
+#endif // WebFramePolicyListenerProxy_h
diff --git a/WebKit2/UIProcess/WebFrameListenerProxy.cpp b/WebKit2/UIProcess/WebFrameListenerProxy.cpp
new file mode 100644
index 0000000..c4e38ee
--- /dev/null
+++ b/WebKit2/UIProcess/WebFrameListenerProxy.cpp
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "WebFrameListenerProxy.h"
+
+#include "WebFrameProxy.h"
+
+namespace WebKit {
+
+WebFrameListenerProxy::WebFrameListenerProxy(WebFrameProxy* frame, uint64_t listenerID)
+    : m_frame(frame)
+    , m_listenerID(listenerID)
+{
+}
+
+WebFrameListenerProxy::~WebFrameListenerProxy()
+{
+}
+
+void WebFrameListenerProxy::invalidate()
+{
+    m_frame = 0;
+}
+
+void WebFrameListenerProxy::receivedPolicyDecision(WebCore::PolicyAction action)
+{
+    if (!m_frame)
+        return;
+
+    m_frame->receivedPolicyDecision(action, m_listenerID);
+    m_frame = 0;
+}
+
+} // namespace WebKit
diff --git a/WebKit2/UIProcess/WebFrameListenerProxy.h b/WebKit2/UIProcess/WebFrameListenerProxy.h
new file mode 100644
index 0000000..fd9ad71
--- /dev/null
+++ b/WebKit2/UIProcess/WebFrameListenerProxy.h
@@ -0,0 +1,57 @@
+/*
+ * Copyright (C) 2010 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFrameListenerProxy_h
+#define WebFrameListenerProxy_h
+
+#include "APIObject.h"
+#include <WebCore/FrameLoaderTypes.h>
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace WebKit {
+
+class WebFrameProxy;
+
+class WebFrameListenerProxy : public APIObject {
+public:
+    virtual ~WebFrameListenerProxy();
+
+    void invalidate();
+    uint64_t listenerID() const { return m_listenerID; }
+
+protected:
+    WebFrameListenerProxy(WebFrameProxy*, uint64_t listenerID);
+
+    void receivedPolicyDecision(WebCore::PolicyAction);
+
+private:
+    RefPtr<WebFrameProxy> m_frame;
+    uint64_t m_listenerID;
+};
+
+} // namespace WebKit
+
+#endif // WebFrameListenerProxy_h
diff --git a/WebKit2/UIProcess/WebFramePolicyListenerProxy.cpp b/WebKit2/UIProcess/WebFramePolicyListenerProxy.cpp
index b7b801f..865d352 100644
--- a/WebKit2/UIProcess/WebFramePolicyListenerProxy.cpp
+++ b/WebKit2/UIProcess/WebFramePolicyListenerProxy.cpp
@@ -30,29 +30,10 @@
 namespace WebKit {
 
 WebFramePolicyListenerProxy::WebFramePolicyListenerProxy(WebFrameProxy* frame, uint64_t listenerID)
-    : m_frame(frame)
-    , m_listenerID(listenerID)
+    : WebFrameListenerProxy(frame, listenerID)
 {
 }
 
-WebFramePolicyListenerProxy::~WebFramePolicyListenerProxy()
-{
-}
-
-void WebFramePolicyListenerProxy::invalidate()
-{
-    m_frame = 0;
-}
-
-void WebFramePolicyListenerProxy::receivedPolicyDecision(WebCore::PolicyAction action)
-{
-    if (!m_frame)
-        return;
-
-    m_frame->receivedPolicyDecision(action, m_listenerID);
-    m_frame = 0;
-}
-
 void WebFramePolicyListenerProxy::use()
 {
     receivedPolicyDecision(WebCore::PolicyUse);
diff --git a/WebKit2/UIProcess/WebFramePolicyListenerProxy.h b/WebKit2/UIProcess/WebFramePolicyListenerProxy.h
index 71708af..779d2a5 100644
--- a/WebKit2/UIProcess/WebFramePolicyListenerProxy.h
+++ b/WebKit2/UIProcess/WebFramePolicyListenerProxy.h
@@ -26,16 +26,11 @@
 #ifndef WebFramePolicyListenerProxy_h
 #define WebFramePolicyListenerProxy_h
 
-#include "APIObject.h"
-#include <WebCore/FrameLoaderTypes.h>
-#include <wtf/PassRefPtr.h>
-#include <wtf/RefPtr.h>
+#include "WebFrameListenerProxy.h"
 
 namespace WebKit {
 
-class WebFrameProxy;
-
-class WebFramePolicyListenerProxy : public APIObject {
+class WebFramePolicyListenerProxy : public WebFrameListenerProxy {
 public:
     static const Type APIType = TypeFramePolicyListener;
 
@@ -43,25 +38,15 @@ public:
     {
         return adoptRef(new WebFramePolicyListenerProxy(frame, listenerID));
     }
-    ~WebFramePolicyListenerProxy();
 
     void use();
     void download();
     void ignore();
 
-    void invalidate();
-
-    uint64_t listenerID() const { return m_listenerID; }
-
 private:
     WebFramePolicyListenerProxy(WebFrameProxy*, uint64_t listenerID);
 
     virtual Type type() const { return APIType; }
-
-    void receivedPolicyDecision(WebCore::PolicyAction);
-
-    RefPtr<WebFrameProxy> m_frame;
-    uint64_t m_listenerID;
 };
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebFrameProxy.cpp b/WebKit2/UIProcess/WebFrameProxy.cpp
index 0304dad..40d9f69 100644
--- a/WebKit2/UIProcess/WebFrameProxy.cpp
+++ b/WebKit2/UIProcess/WebFrameProxy.cpp
@@ -26,6 +26,8 @@
 #include "WebFrameProxy.h"
 
 #include "WebPageProxy.h"
+#include "WebFormSubmissionListenerProxy.h"
+#include "WebFramePolicyListenerProxy.h"
 #include <WebCore/PlatformString.h>
 
 using namespace WebCore;
@@ -46,9 +48,9 @@ WebFrameProxy::~WebFrameProxy()
 void WebFrameProxy::disconnect()
 {
     m_page = 0;
-    if (m_policyListener) {
-        m_policyListener->invalidate();
-        m_policyListener = 0;
+    if (m_activeListener) {
+        m_activeListener->invalidate();
+        m_activeListener = 0;
     }
 }
 
@@ -90,17 +92,25 @@ void WebFrameProxy::receivedPolicyDecision(WebCore::PolicyAction action, uint64_
     if (!m_page)
         return;
 
-    ASSERT(m_policyListener);
-    ASSERT(m_policyListener->listenerID() == listenerID);
+    ASSERT(m_activeListener);
+    ASSERT(m_activeListener->listenerID() == listenerID);
     m_page->receivedPolicyDecision(action, this, listenerID);
 }
 
 WebFramePolicyListenerProxy* WebFrameProxy::setUpPolicyListenerProxy(uint64_t listenerID)
 {
-    if (m_policyListener)
-        m_policyListener->invalidate();
-    m_policyListener = WebFramePolicyListenerProxy::create(this, listenerID);
-    return m_policyListener.get();
+    if (m_activeListener)
+        m_activeListener->invalidate();
+    m_activeListener = WebFramePolicyListenerProxy::create(this, listenerID);
+    return static_cast<WebFramePolicyListenerProxy*>(m_activeListener.get());
+}
+
+WebFormSubmissionListenerProxy* WebFrameProxy::setUpFormSubmissionListenerProxy(uint64_t listenerID)
+{
+    if (m_activeListener)
+        m_activeListener->invalidate();
+    m_activeListener = WebFormSubmissionListenerProxy::create(this, listenerID);
+    return static_cast<WebFormSubmissionListenerProxy*>(m_activeListener.get());
 }
 
 } // namespace WebKit
diff --git a/WebKit2/UIProcess/WebFrameProxy.h b/WebKit2/UIProcess/WebFrameProxy.h
index 4b97593..c629779 100644
--- a/WebKit2/UIProcess/WebFrameProxy.h
+++ b/WebKit2/UIProcess/WebFrameProxy.h
@@ -27,7 +27,7 @@
 #define WebFrameProxy_h
 
 #include "APIObject.h"
-#include "WebFramePolicyListenerProxy.h"
+#include "WebFrameListenerProxy.h"
 #include <WebCore/FrameLoaderTypes.h>
 #include <WebCore/PlatformString.h>
 #include <wtf/Forward.h>
@@ -42,6 +42,8 @@ namespace CoreIPC {
 namespace WebKit {
 
 class WebPageProxy;
+class WebFramePolicyListenerProxy;
+class WebFormSubmissionListenerProxy;
 
 class WebFrameProxy : public APIObject {
 public:
@@ -77,6 +79,7 @@ public:
 
     void receivedPolicyDecision(WebCore::PolicyAction, uint64_t listenerID);
     WebFramePolicyListenerProxy* setUpPolicyListenerProxy(uint64_t listenerID);
+    WebFormSubmissionListenerProxy* setUpFormSubmissionListenerProxy(uint64_t listenerID);
 
 private:
     WebFrameProxy(WebPageProxy* page, uint64_t frameID);
@@ -87,7 +90,7 @@ private:
     LoadState m_loadState;
     WTF::String m_url;
     WTF::String m_provisionalURL;
-    RefPtr<WebFramePolicyListenerProxy> m_policyListener;
+    RefPtr<WebFrameListenerProxy> m_activeListener;
     uint64_t m_frameID;
 };
 
diff --git a/WebKit2/UIProcess/WebPageProxy.cpp b/WebKit2/UIProcess/WebPageProxy.cpp
index 8e7cd53..93afaac 100644
--- a/WebKit2/UIProcess/WebPageProxy.cpp
+++ b/WebKit2/UIProcess/WebPageProxy.cpp
@@ -34,6 +34,8 @@
 #include "WebCoreArgumentCoders.h"
 #include "WebData.h"
 #include "WebEvent.h"
+#include "WebFormSubmissionListenerProxy.h"
+#include "WebFramePolicyListenerProxy.h"
 #include "WebPageMessageKinds.h"
 #include "WebPageNamespace.h"
 #include "WebPageProxyMessageKinds.h"
@@ -118,6 +120,11 @@ void WebPageProxy::initializePolicyClient(const WKPagePolicyClient* policyClient
     m_policyClient.initialize(policyClient);
 }
 
+void WebPageProxy::initializeFormClient(const WKPageFormClient* formClient)
+{
+    m_formClient.initialize(formClient);
+}
+
 void WebPageProxy::initializeUIClient(const WKPageUIClient* client)
 {
     m_uiClient.initialize(client);
@@ -533,6 +540,16 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M
             decidePolicyForMIMEType(webFrame(frameID), MIMEType, url, listenerID);
             break;
         }
+        case WebPageProxyMessage::WillSubmitForm: {
+            uint64_t frameID;
+            uint64_t sourceFrameID;
+            uint64_t listenerID;
+            if (!arguments->decode(CoreIPC::Out(frameID, sourceFrameID, listenerID)))
+                return;
+            willSubmitForm(webFrame(frameID), webFrame(sourceFrameID), listenerID);
+            break;
+        }
+        
         case WebPageProxyMessage::DidRunJavaScriptInMainFrame: {
             String resultString;
             uint64_t callbackID;
@@ -817,7 +834,17 @@ void WebPageProxy::decidePolicyForMIMEType(WebFrameProxy* frame, const String& M
         listener->use();
 }
 
+// FormClient
+
+void WebPageProxy::willSubmitForm(WebFrameProxy* frame, WebFrameProxy* sourceFrame, uint64_t listenerID)
+{
+    RefPtr<WebFormSubmissionListenerProxy> listener = frame->setUpFormSubmissionListenerProxy(listenerID);
+    if (!m_formClient.willSubmitForm(this, frame, sourceFrame, listener.get()))
+        listener->continueSubmission();
+}
+
 // UIClient
+
 PassRefPtr<WebPageProxy> WebPageProxy::createNewPage()
 {
     return m_uiClient.createNewPage(this);
diff --git a/WebKit2/UIProcess/WebPageProxy.h b/WebKit2/UIProcess/WebPageProxy.h
index 604b2f8..c31e2dd 100644
--- a/WebKit2/UIProcess/WebPageProxy.h
+++ b/WebKit2/UIProcess/WebPageProxy.h
@@ -31,6 +31,7 @@
 #include "GenericCallback.h"
 #include "WKBase.h"
 #include "WebEvent.h"
+#include "WebFormClient.h"
 #include "WebFrameProxy.h"
 #include "WebHistoryClient.h"
 #include "WebLoaderClient.h"
@@ -94,6 +95,7 @@ public:
     void setPageClient(PageClient*);
     void initializeLoaderClient(const WKPageLoaderClient*);
     void initializePolicyClient(const WKPagePolicyClient*);
+    void initializeFormClient(const WKPageFormClient*);
     void initializeUIClient(const WKPageUIClient*);
 
     void revive();
@@ -190,6 +192,8 @@ private:
     void decidePolicyForNewWindowAction(WebFrameProxy*, WebCore::NavigationType navigationType, const WTF::String& url, uint64_t listenerID);
     void decidePolicyForMIMEType(WebFrameProxy*, const WTF::String& MIMEType, const WTF::String& url, uint64_t listenerID);
 
+    void willSubmitForm(WebFrameProxy* frame, WebFrameProxy* frameSource, uint64_t listenerID);
+
     PassRefPtr<WebPageProxy> createNewPage();
     void showPage();
     void closePage();
@@ -215,6 +219,7 @@ private:
     PageClient* m_pageClient;
     WebLoaderClient m_loaderClient;
     WebPolicyClient m_policyClient;
+    WebFormClient m_formClient;
     WebUIClient m_uiClient;
 
     OwnPtr<DrawingAreaProxy> m_drawingArea;
diff --git a/WebKit2/WebKit2.xcodeproj/project.pbxproj b/WebKit2/WebKit2.xcodeproj/project.pbxproj
index 89676c8..48a6a37 100644
--- a/WebKit2/WebKit2.xcodeproj/project.pbxproj
+++ b/WebKit2/WebKit2.xcodeproj/project.pbxproj
@@ -276,6 +276,14 @@
 		BCDB86C11200FB97007254BE /* WebURL.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDB86C01200FB97007254BE /* WebURL.h */; };
 		BCDE059B11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCDE059911CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h */; };
 		BCDE059C11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */; };
+		BCE469531214E6CB000B98EB /* WebFormClient.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE4694F1214E6CB000B98EB /* WebFormClient.cpp */; };
+		BCE469541214E6CB000B98EB /* WebFormClient.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469501214E6CB000B98EB /* WebFormClient.h */; };
+		BCE469551214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE469511214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp */; };
+		BCE469561214E6CB000B98EB /* WebFormSubmissionListenerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469521214E6CB000B98EB /* WebFormSubmissionListenerProxy.h */; };
+		BCE469591214EDF4000B98EB /* WKFormSubmissionListener.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE469571214EDF4000B98EB /* WKFormSubmissionListener.cpp */; };
+		BCE4695A1214EDF4000B98EB /* WKFormSubmissionListener.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469581214EDF4000B98EB /* WKFormSubmissionListener.h */; settings = {ATTRIBUTES = (Public, ); }; };
+		BCE469771214F27B000B98EB /* WebFrameListenerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = BCE469761214F27B000B98EB /* WebFrameListenerProxy.h */; };
+		BCE469791214F2B4000B98EB /* WebFrameListenerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCE469781214F2B4000B98EB /* WebFrameListenerProxy.cpp */; };
 		BCEE966C112FAF57006BCC24 /* Attachment.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE966A112FAF57006BCC24 /* Attachment.cpp */; };
 		BCEE966D112FAF57006BCC24 /* Attachment.h in Headers */ = {isa = PBXBuildFile; fileRef = BCEE966B112FAF57006BCC24 /* Attachment.h */; };
 		BCEE98C6113314D7006BCC24 /* WebPageNamespace.cpp in Sources */ = {isa = PBXBuildFile; fileRef = BCEE98C4113314D7006BCC24 /* WebPageNamespace.cpp */; };
@@ -607,6 +615,14 @@
 		BCDB86C01200FB97007254BE /* WebURL.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebURL.h; sourceTree = "<group>"; };
 		BCDE059911CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebContextInjectedBundleClient.h; sourceTree = "<group>"; };
 		BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebContextInjectedBundleClient.cpp; sourceTree = "<group>"; };
+		BCE4694F1214E6CB000B98EB /* WebFormClient.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFormClient.cpp; sourceTree = "<group>"; };
+		BCE469501214E6CB000B98EB /* WebFormClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFormClient.h; sourceTree = "<group>"; };
+		BCE469511214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFormSubmissionListenerProxy.cpp; sourceTree = "<group>"; };
+		BCE469521214E6CB000B98EB /* WebFormSubmissionListenerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFormSubmissionListenerProxy.h; sourceTree = "<group>"; };
+		BCE469571214EDF4000B98EB /* WKFormSubmissionListener.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WKFormSubmissionListener.cpp; sourceTree = "<group>"; };
+		BCE469581214EDF4000B98EB /* WKFormSubmissionListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WKFormSubmissionListener.h; sourceTree = "<group>"; };
+		BCE469761214F27B000B98EB /* WebFrameListenerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameListenerProxy.h; sourceTree = "<group>"; };
+		BCE469781214F2B4000B98EB /* WebFrameListenerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFrameListenerProxy.cpp; sourceTree = "<group>"; };
 		BCEE966A112FAF57006BCC24 /* Attachment.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Attachment.cpp; sourceTree = "<group>"; };
 		BCEE966B112FAF57006BCC24 /* Attachment.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = Attachment.h; sourceTree = "<group>"; };
 		BCEE98C4113314D7006BCC24 /* WebPageNamespace.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPageNamespace.cpp; sourceTree = "<group>"; };
@@ -989,8 +1005,14 @@
 				BCB9E2411120DACA00A137E0 /* WebContext.h */,
 				BCDE059A11CDA8AE00E41AF1 /* WebContextInjectedBundleClient.cpp */,
 				BCDE059911CDA8AE00E41AF1 /* WebContextInjectedBundleClient.h */,
+				BCE4694F1214E6CB000B98EB /* WebFormClient.cpp */,
+				BCE469501214E6CB000B98EB /* WebFormClient.h */,
+				BCE469511214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp */,
+				BCE469521214E6CB000B98EB /* WebFormSubmissionListenerProxy.h */,
 				BCB9F69F1123A84B00A137E0 /* WebFramePolicyListenerProxy.cpp */,
 				BCB9F69E1123A84B00A137E0 /* WebFramePolicyListenerProxy.h */,
+				BCE469781214F2B4000B98EB /* WebFrameListenerProxy.cpp */,
+				BCE469761214F27B000B98EB /* WebFrameListenerProxy.h */,
 				BC111B0A112F5E4F00337BAB /* WebFrameProxy.cpp */,
 				BC9B389F10F538BE00443A15 /* WebFrameProxy.h */,
 				BCF69F841176CD6F00471A52 /* WebHistoryClient.cpp */,
@@ -1047,6 +1069,8 @@
 				514AF6C71209EE7300A26C97 /* WKData.h */,
 				516A4A58120A1AB500C05B7F /* WKError.cpp */,
 				516A4A57120A1AB500C05B7F /* WKError.h */,
+				BCE469571214EDF4000B98EB /* WKFormSubmissionListener.cpp */,
+				BCE469581214EDF4000B98EB /* WKFormSubmissionListener.h */,
 				BCD01398110FA420003B8A67 /* WKFrame.cpp */,
 				BCD01397110FA420003B8A67 /* WKFrame.h */,
 				BCB9F6A41123DD0D00A137E0 /* WKFramePolicyListener.cpp */,
@@ -1448,6 +1472,10 @@
 				BC14DF77120B5B7900826C0C /* InjectedBundleScriptWorld.h in Headers */,
 				BC14DF9F120B635F00826C0C /* WKBundleScriptWorld.h in Headers */,
 				BC14E10A120B905E00826C0C /* InjectedBundlePageFormClient.h in Headers */,
+				BCE469541214E6CB000B98EB /* WebFormClient.h in Headers */,
+				BCE469561214E6CB000B98EB /* WebFormSubmissionListenerProxy.h in Headers */,
+				BCE4695A1214EDF4000B98EB /* WKFormSubmissionListener.h in Headers */,
+				BCE469771214F27B000B98EB /* WebFrameListenerProxy.h in Headers */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
@@ -1664,6 +1692,10 @@
 				BC14DF78120B5B7900826C0C /* InjectedBundleScriptWorld.cpp in Sources */,
 				BC14DF9E120B635F00826C0C /* WKBundleScriptWorld.cpp in Sources */,
 				BC14E109120B905E00826C0C /* InjectedBundlePageFormClient.cpp in Sources */,
+				BCE469531214E6CB000B98EB /* WebFormClient.cpp in Sources */,
+				BCE469551214E6CB000B98EB /* WebFormSubmissionListenerProxy.cpp in Sources */,
+				BCE469591214EDF4000B98EB /* WKFormSubmissionListener.cpp in Sources */,
+				BCE469791214F2B4000B98EB /* WebFrameListenerProxy.cpp in Sources */,
 			);
 			runOnlyForDeploymentPostprocessing = 0;
 		};
diff --git a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
index 925f435..898820c 100644
--- a/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
+++ b/WebKit2/WebProcess/WebCoreSupport/WebFrameLoaderClient.cpp
@@ -465,12 +465,20 @@ void WebFrameLoaderClient::dispatchUnableToImplementPolicy(const ResourceError&)
     notImplemented();
 }
 
-void WebFrameLoaderClient::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<FormState>)
+void WebFrameLoaderClient::dispatchWillSubmitForm(FramePolicyFunction function, PassRefPtr<FormState> formState)
 {
-    notImplemented();
+    WebPage* webPage = m_frame->page();
+    if (!webPage)
+        return;
 
-    Frame* coreFrame = m_frame->coreFrame();
-    (coreFrame->loader()->policyChecker()->*function)(PolicyUse);
+    // FIXME: Pass more of the form state.
+
+    uint64_t listenerID = m_frame->setUpPolicyListener(function);
+
+    WebFrame* sourceFrame = static_cast<WebFrameLoaderClient*>(formState->sourceFrame()->loader()->client())->webFrame();    
+
+    WebProcess::shared().connection()->send(WebPageProxyMessage::WillSubmitForm, webPage->pageID(),
+                                            CoreIPC::In(m_frame->frameID(), sourceFrame->frameID(), listenerID));
 }
 
 void WebFrameLoaderClient::dispatchDidLoadMainResource(DocumentLoader*)
diff --git a/WebKit2/win/WebKit2.vcproj b/WebKit2/win/WebKit2.vcproj
index 0154339..3813965 100755
--- a/WebKit2/win/WebKit2.vcproj
+++ b/WebKit2/win/WebKit2.vcproj
@@ -1049,6 +1049,22 @@
 				>
 			</File>
 			<File
+				RelativePath="..\UIProcess\WebFormClient.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\UIProcess\WebFormClient.h"
+				>
+			</File>
+			<File
+				RelativePath="..\UIProcess\WebFormSubmissionListenerProxy.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\UIProcess\WebFormSubmissionListenerProxy.h"
+				>
+			</File>
+			<File
 				RelativePath="..\UIProcess\WebFramePolicyListenerProxy.cpp"
 				>
 			</File>
@@ -1057,6 +1073,14 @@
 				>
 			</File>
 			<File
+				RelativePath="..\UIProcess\WebFrameListenerProxy.cpp"
+				>
+			</File>
+			<File
+				RelativePath="..\UIProcess\WebFrameListenerProxy.h"
+				>
+			</File>
+			<File
 				RelativePath="..\UIProcess\WebFrameProxy.cpp"
 				>
 			</File>
@@ -1223,6 +1247,14 @@
 						>
 					</File>
 					<File
+						RelativePath="..\UIProcess\API\C\WKFormSubmissionListener.cpp"
+						>
+					</File>
+					<File
+						RelativePath="..\UIProcess\API\C\WKFormSubmissionListener.h"
+						>
+					</File>
+					<File
 						RelativePath="..\UIProcess\API\C\WKFrame.cpp"
 						>
 					</File>
diff --git a/WebKit2/win/WebKit2Generated.make b/WebKit2/win/WebKit2Generated.make
index 86a80e8..7435519 100644
--- a/WebKit2/win/WebKit2Generated.make
+++ b/WebKit2/win/WebKit2Generated.make
@@ -10,6 +10,7 @@ all:
     xcopy /y /d "..\UIProcess\API\C\WKContextPrivate.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKData.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKError.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
+    xcopy /y /d "..\UIProcess\API\C\WKFormSubmissionListener.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKFrame.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKFramePolicyListener.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"
     xcopy /y /d "..\UIProcess\API\C\WKNavigationData.h" "$(WEBKITOUTPUTDIR)\include\WebKit2"

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list