Title: [132334] trunk/Source/WebKit2
Revision
132334
Author
[email protected]
Date
2012-10-24 04:02:12 -0700 (Wed, 24 Oct 2012)

Log Message

[EFL][WK2] Make find and form clients C++ classes
https://bugs.webkit.org/show_bug.cgi?id=100199

Patch by Christophe Dumez <[email protected]> on 2012-10-24
Reviewed by Kenneth Rohde Christiansen.

Make form and find client C++ classes to move away
from C'ism in WK2 EFL port. The new classes have been
moved up to UIProcess/efl instead of UIProcess/API/efl
since it is not part of the public API.

* PlatformEfl.cmake:
* UIProcess/API/efl/ewk_view.cpp:
(Ewk_View_Private_Data):
(_ewk_view_initialize):
* UIProcess/efl/FindClientEfl.cpp: Renamed from Source/WebKit2/UIProcess/API/efl/ewk_view_find_client.cpp.
(WebKit):
(WebKit::toFindClientEfl):
(WebKit::FindClientEfl::didFindString):
(WebKit::FindClientEfl::didFailToFindString):
(WebKit::FindClientEfl::FindClientEfl):
* UIProcess/efl/FindClientEfl.h: Renamed from Source/WebKit2/UIProcess/API/efl/ewk_view_find_client_private.h.
(WebKit):
(FindClientEfl):
(WebKit::FindClientEfl::create):
* UIProcess/efl/FormClientEfl.cpp: Renamed from Source/WebKit2/UIProcess/API/efl/ewk_view_form_client.cpp.
(WebKit):
(WebKit::toFormClientEfl):
(WebKit::FormClientEfl::willSubmitForm):
(WebKit::FormClientEfl::FormClientEfl):
* UIProcess/efl/FormClientEfl.h: Renamed from Source/WebKit2/UIProcess/API/efl/ewk_view_form_client_private.h.
(WebKit):
(FormClientEfl):
(WebKit::FormClientEfl::create):

Modified Paths

Added Paths

Removed Paths

Diff

Modified: trunk/Source/WebKit2/ChangeLog (132333 => 132334)


--- trunk/Source/WebKit2/ChangeLog	2012-10-24 10:58:59 UTC (rev 132333)
+++ trunk/Source/WebKit2/ChangeLog	2012-10-24 11:02:12 UTC (rev 132334)
@@ -1,3 +1,39 @@
+2012-10-24  Christophe Dumez  <[email protected]>
+
+        [EFL][WK2] Make find and form clients C++ classes
+        https://bugs.webkit.org/show_bug.cgi?id=100199
+
+        Reviewed by Kenneth Rohde Christiansen.
+
+        Make form and find client C++ classes to move away
+        from C'ism in WK2 EFL port. The new classes have been
+        moved up to UIProcess/efl instead of UIProcess/API/efl
+        since it is not part of the public API.
+
+        * PlatformEfl.cmake:
+        * UIProcess/API/efl/ewk_view.cpp:
+        (Ewk_View_Private_Data):
+        (_ewk_view_initialize):
+        * UIProcess/efl/FindClientEfl.cpp: Renamed from Source/WebKit2/UIProcess/API/efl/ewk_view_find_client.cpp.
+        (WebKit):
+        (WebKit::toFindClientEfl):
+        (WebKit::FindClientEfl::didFindString):
+        (WebKit::FindClientEfl::didFailToFindString):
+        (WebKit::FindClientEfl::FindClientEfl):
+        * UIProcess/efl/FindClientEfl.h: Renamed from Source/WebKit2/UIProcess/API/efl/ewk_view_find_client_private.h.
+        (WebKit):
+        (FindClientEfl):
+        (WebKit::FindClientEfl::create):
+        * UIProcess/efl/FormClientEfl.cpp: Renamed from Source/WebKit2/UIProcess/API/efl/ewk_view_form_client.cpp.
+        (WebKit):
+        (WebKit::toFormClientEfl):
+        (WebKit::FormClientEfl::willSubmitForm):
+        (WebKit::FormClientEfl::FormClientEfl):
+        * UIProcess/efl/FormClientEfl.h: Renamed from Source/WebKit2/UIProcess/API/efl/ewk_view_form_client_private.h.
+        (WebKit):
+        (FormClientEfl):
+        (WebKit::FormClientEfl::create):
+
 2012-10-24  Grzegorz Czajkowski  <[email protected]>
 
         [EFL] WebKitTestRunner needs to turn on 'setContinuousSpellCheckingEnabled'

Modified: trunk/Source/WebKit2/PlatformEfl.cmake (132333 => 132334)


--- trunk/Source/WebKit2/PlatformEfl.cmake	2012-10-24 10:58:59 UTC (rev 132333)
+++ trunk/Source/WebKit2/PlatformEfl.cmake	2012-10-24 11:02:12 UTC (rev 132334)
@@ -68,13 +68,13 @@
     UIProcess/API/efl/ewk_url_response.cpp
     UIProcess/API/efl/ewk_url_scheme_request.cpp
     UIProcess/API/efl/ewk_view.cpp
-    UIProcess/API/efl/ewk_view_find_client.cpp
-    UIProcess/API/efl/ewk_view_form_client.cpp
 
     UIProcess/cairo/BackingStoreCairo.cpp
 
     UIProcess/efl/ContextHistoryClientEfl.cpp
     UIProcess/efl/DownloadManagerEfl.cpp
+    UIProcess/efl/FindClientEfl.cpp
+    UIProcess/efl/FormClientEfl.cpp
     UIProcess/efl/PageLoadClientEfl.cpp
     UIProcess/efl/PagePolicyClientEfl.cpp
     UIProcess/efl/PageUIClientEfl.cpp

Modified: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp (132333 => 132334)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-10-24 10:58:59 UTC (rev 132333)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view.cpp	2012-10-24 11:02:12 UTC (rev 132334)
@@ -21,6 +21,8 @@
 #include "config.h"
 #include "ewk_view.h"
 
+#include "FindClientEfl.h"
+#include "FormClientEfl.h"
 #include "NativeWebKeyboardEvent.h"
 #include "NativeWebMouseEvent.h"
 #include "NativeWebWheelEvent.h"
@@ -53,8 +55,6 @@
 #include "ewk_resource.h"
 #include "ewk_resource_private.h"
 #include "ewk_settings_private.h"
-#include "ewk_view_find_client_private.h"
-#include "ewk_view_form_client_private.h"
 #include "ewk_view_private.h"
 #include <Ecore_Evas.h>
 #include <Ecore_IMF.h>
@@ -129,6 +129,8 @@
     OwnPtr<PagePolicyClientEfl> pagePolicyClient;
     OwnPtr<PageUIClientEfl> pageUIClient;
     OwnPtr<ResourceLoadClientEfl> resourceLoadClient;
+    OwnPtr<FindClientEfl> findClient;
+    OwnPtr<FormClientEfl> formClient;
 
     WKEinaSharedString url;
     WKEinaSharedString title;
@@ -923,18 +925,18 @@
     priv->pageClient->setPageViewportController(priv->pageViewportController.get());
 #endif
 
-    // Initialize page clients.
-    WKPageRef wkPage = toAPI(priv->pageProxy.get());
-    ewk_view_find_client_attach(wkPage, ewkView);
-    ewk_view_form_client_attach(wkPage, ewkView);
 #if ENABLE(FULLSCREEN_API)
     priv->pageProxy->fullScreenManager()->setWebView(ewkView);
     ewk_settings_fullscreen_enabled_set(priv->settings.get(), true);
 #endif
+
+    // Initialize page clients.
     priv->pageLoadClient = PageLoadClientEfl::create(ewkView);
     priv->pagePolicyClient = PagePolicyClientEfl::create(ewkView);
     priv->pageUIClient = PageUIClientEfl::create(ewkView);
     priv->resourceLoadClient = ResourceLoadClientEfl::create(ewkView);
+    priv->findClient = FindClientEfl::create(ewkView);
+    priv->formClient = FormClientEfl::create(ewkView);
 
     /* Listen for favicon changes */
     Ewk_Favicon_Database* iconDatabase = priv->context->faviconDatabase();

Deleted: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client.cpp (132333 => 132334)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client.cpp	2012-10-24 10:58:59 UTC (rev 132333)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client.cpp	2012-10-24 11:02:12 UTC (rev 132334)
@@ -1,62 +0,0 @@
-/*
- * Copyright (C) 2012 Samsung Electronics. 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 "config.h"
-
-#include "WKPage.h"
-#include "ewk_view_find_client_private.h"
-#include "ewk_view_private.h"
-
-static inline Evas_Object* toEwkView(const void* clientInfo)
-{
-    return static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
-}
-
-static void didFindString(WKPageRef, WKStringRef, unsigned matchCount, const void* clientInfo)
-{
-    ewk_view_text_found(toEwkView(clientInfo), matchCount);
-}
-
-static void didFailToFindString(WKPageRef, WKStringRef, const void* clientInfo)
-{
-    ewk_view_text_found(toEwkView(clientInfo), 0);
-}
-
-static void didCountStringMatches(WKPageRef, WKStringRef, unsigned matchCount, const void* clientInfo)
-{
-    ewk_view_text_found(toEwkView(clientInfo), matchCount);
-}
-
-void ewk_view_find_client_attach(WKPageRef pageRef, Evas_Object* ewkView)
-{
-    WKPageFindClient findClient;
-    memset(&findClient, 0, sizeof(WKPageFindClient));
-    findClient.version = kWKPageFindClientCurrentVersion;
-    findClient.clientInfo = ewkView;
-    findClient.didFindString = didFindString;
-    findClient.didFailToFindString = didFailToFindString;
-    findClient.didCountStringMatches = didCountStringMatches;
-    WKPageSetPageFindClient(pageRef, &findClient);
-}

Deleted: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client_private.h (132333 => 132334)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client_private.h	2012-10-24 10:58:59 UTC (rev 132333)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client_private.h	2012-10-24 11:02:12 UTC (rev 132334)
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2012 Samsung Electronics. 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 ewk_view_find_client_private_h
-#define ewk_view_find_client_private_h
-
-#include <Evas.h>
-#include <WebKit2/WKBase.h>
-
-void ewk_view_find_client_attach(WKPageRef pageRef, Evas_Object* ewkView);
-
-#endif // ewk_view_find_client_private_h

Deleted: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client.cpp (132333 => 132334)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client.cpp	2012-10-24 10:58:59 UTC (rev 132333)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client.cpp	2012-10-24 11:02:12 UTC (rev 132334)
@@ -1,50 +0,0 @@
-/*
- * Copyright (C) 2012 Intel Corporation. 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 "config.h"
-
-#include "WKPage.h"
-#include "ewk_form_submission_request.h"
-#include "ewk_form_submission_request_private.h"
-#include "ewk_view_form_client_private.h"
-#include "ewk_view_private.h"
-
-static void willSubmitForm(WKPageRef, WKFrameRef /*frame*/, WKFrameRef /*sourceFrame*/, WKDictionaryRef values, WKTypeRef /*userData*/, WKFormSubmissionListenerRef listener, const void* clientInfo)
-{
-    Evas_Object* ewkView = static_cast<Evas_Object*>(const_cast<void*>(clientInfo));
-
-    RefPtr<Ewk_Form_Submission_Request> request = Ewk_Form_Submission_Request::create(values, listener);
-    ewk_view_form_submission_request_new(ewkView, request.get());
-}
-
-void ewk_view_form_client_attach(WKPageRef pageRef, Evas_Object* ewkView)
-{
-    WKPageFormClient formClient;
-    memset(&formClient, 0, sizeof(WKPageFormClient));
-    formClient.version = kWKPageFormClientCurrentVersion;
-    formClient.clientInfo = ewkView;
-    formClient.willSubmitForm = willSubmitForm;
-    WKPageSetPageFormClient(pageRef, &formClient);
-}

Deleted: trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client_private.h (132333 => 132334)


--- trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client_private.h	2012-10-24 10:58:59 UTC (rev 132333)
+++ trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client_private.h	2012-10-24 11:02:12 UTC (rev 132334)
@@ -1,34 +0,0 @@
-/*
- * Copyright (C) 2012 Intel Corporation. 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 ewk_view_form_client_private_h
-#define ewk_view_form_client_private_h
-
-#include <Evas.h>
-#include <WebKit2/WKBase.h>
-
-void ewk_view_form_client_attach(WKPageRef pageRef, Evas_Object* ewkView);
-
-#endif // ewk_view_form_client_private_h

Copied: trunk/Source/WebKit2/UIProcess/efl/FindClientEfl.cpp (from rev 132333, trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client.cpp) (0 => 132334)


--- trunk/Source/WebKit2/UIProcess/efl/FindClientEfl.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/efl/FindClientEfl.cpp	2012-10-24 11:02:12 UTC (rev 132334)
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics. All rights reserved.
+ * Copyright (C) 2012 Intel Corporation. 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 "config.h"
+#include "FindClientEfl.h"
+
+#include "WKPage.h"
+#include "ewk_view_private.h"
+
+namespace WebKit {
+
+static inline FindClientEfl* toFindClientEfl(const void* clientInfo)
+{
+    return static_cast<FindClientEfl*>(const_cast<void*>(clientInfo));
+}
+
+void FindClientEfl::didFindString(WKPageRef, WKStringRef, unsigned matchCount, const void* clientInfo)
+{
+    FindClientEfl* findClient = toFindClientEfl(clientInfo);
+    ewk_view_text_found(findClient->m_view, matchCount);
+}
+
+void FindClientEfl::didFailToFindString(WKPageRef, WKStringRef, const void* clientInfo)
+{
+    FindClientEfl* findClient = toFindClientEfl(clientInfo);
+    ewk_view_text_found(findClient->m_view, 0);
+}
+
+FindClientEfl::FindClientEfl(Evas_Object* view)
+    : m_view(view)
+{
+    WKPageRef pageRef = ewk_view_wkpage_get(m_view);
+    ASSERT(pageRef);
+
+    WKPageFindClient findClient;
+    memset(&findClient, 0, sizeof(WKPageFindClient));
+    findClient.version = kWKPageFindClientCurrentVersion;
+    findClient.clientInfo = this;
+    findClient.didFindString = didFindString;
+    findClient.didFailToFindString = didFailToFindString;
+    findClient.didCountStringMatches = didFindString;
+    WKPageSetPageFindClient(pageRef, &findClient);
+}
+
+} // namespace WebKit

Copied: trunk/Source/WebKit2/UIProcess/efl/FindClientEfl.h (from rev 132333, trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_find_client_private.h) (0 => 132334)


--- trunk/Source/WebKit2/UIProcess/efl/FindClientEfl.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/efl/FindClientEfl.h	2012-10-24 11:02:12 UTC (rev 132334)
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2012 Samsung Electronics. All rights reserved.
+ * Copyright (C) 2012 Intel Corporation. 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 FindClientEfl_h
+#define FindClientEfl_h
+
+#include <WebKit2/WKBase.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebKit {
+
+class FindClientEfl {
+public:
+    static PassOwnPtr<FindClientEfl> create(Evas_Object* view)
+    {
+        return adoptPtr(new FindClientEfl(view));
+    }
+
+private:
+    explicit FindClientEfl(Evas_Object* view);
+
+    static void didFindString(WKPageRef, WKStringRef, unsigned matchCount, const void* clientInfo);
+    static void didFailToFindString(WKPageRef, WKStringRef, const void* clientInfo);
+
+    Evas_Object* m_view;
+};
+
+} // namespace WebKit
+
+#endif // FindClientEfl_h

Copied: trunk/Source/WebKit2/UIProcess/efl/FormClientEfl.cpp (from rev 132333, trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client.cpp) (0 => 132334)


--- trunk/Source/WebKit2/UIProcess/efl/FormClientEfl.cpp	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/efl/FormClientEfl.cpp	2012-10-24 11:02:12 UTC (rev 132334)
@@ -0,0 +1,62 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. 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 "config.h"
+#include "FormClientEfl.h"
+
+#include "WKPage.h"
+#include "ewk_form_submission_request_private.h"
+#include "ewk_view_private.h"
+
+namespace WebKit {
+
+static inline FormClientEfl* toFormClientEfl(const void* clientInfo)
+{
+    return static_cast<FormClientEfl*>(const_cast<void*>(clientInfo));
+}
+
+void FormClientEfl::willSubmitForm(WKPageRef, WKFrameRef /*frame*/, WKFrameRef /*sourceFrame*/, WKDictionaryRef values, WKTypeRef /*userData*/, WKFormSubmissionListenerRef listener, const void* clientInfo)
+{
+    FormClientEfl* formClient = toFormClientEfl(clientInfo);
+
+    RefPtr<Ewk_Form_Submission_Request> request = Ewk_Form_Submission_Request::create(values, listener);
+    ewk_view_form_submission_request_new(formClient->m_view, request.get());
+}
+
+FormClientEfl::FormClientEfl(Evas_Object* view)
+    : m_view(view)
+{
+    WKPageRef pageRef = ewk_view_wkpage_get(m_view);
+    ASSERT(pageRef);
+
+    WKPageFormClient formClient;
+    memset(&formClient, 0, sizeof(WKPageFormClient));
+    formClient.version = kWKPageFormClientCurrentVersion;
+    formClient.clientInfo = this;
+    formClient.willSubmitForm = willSubmitForm;
+    WKPageSetPageFormClient(pageRef, &formClient);
+}
+
+} // namespace WebKit

Copied: trunk/Source/WebKit2/UIProcess/efl/FormClientEfl.h (from rev 132333, trunk/Source/WebKit2/UIProcess/API/efl/ewk_view_form_client_private.h) (0 => 132334)


--- trunk/Source/WebKit2/UIProcess/efl/FormClientEfl.h	                        (rev 0)
+++ trunk/Source/WebKit2/UIProcess/efl/FormClientEfl.h	2012-10-24 11:02:12 UTC (rev 132334)
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2012 Intel Corporation. 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 FormClientEfl_h
+#define FormClientEfl_h
+
+#include <WebKit2/WKBase.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebKit {
+
+class FormClientEfl {
+public:
+    static PassOwnPtr<FormClientEfl> create(Evas_Object* view)
+    {
+        return adoptPtr(new FormClientEfl(view));
+    }
+
+private:
+    explicit FormClientEfl(Evas_Object* view);
+
+    static void willSubmitForm(WKPageRef, WKFrameRef, WKFrameRef, WKDictionaryRef values, WKTypeRef userData, WKFormSubmissionListenerRef, const void* clientInfo);
+
+    Evas_Object* m_view;
+};
+
+} // namespace WebKit
+
+#endif // FormClientEfl_h
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to