summaryrefslogtreecommitdiff
path: root/Source/WebKit2/UIProcess/efl
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebKit2/UIProcess/efl')
-rw-r--r--Source/WebKit2/UIProcess/efl/BatteryProvider.cpp106
-rw-r--r--Source/WebKit2/UIProcess/efl/BatteryProvider.h62
-rw-r--r--Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.cpp144
-rw-r--r--Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.h63
-rw-r--r--Source/WebKit2/UIProcess/efl/DownloadManagerEfl.cpp162
-rw-r--r--Source/WebKit2/UIProcess/efl/DownloadManagerEfl.h68
-rw-r--r--Source/WebKit2/UIProcess/efl/FindClientEfl.cpp71
-rw-r--r--Source/WebKit2/UIProcess/efl/FindClientEfl.h55
-rw-r--r--Source/WebKit2/UIProcess/efl/FormClientEfl.cpp64
-rw-r--r--Source/WebKit2/UIProcess/efl/FormClientEfl.h53
-rw-r--r--Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp132
-rw-r--r--Source/WebKit2/UIProcess/efl/InputMethodContextEfl.h65
-rw-r--r--Source/WebKit2/UIProcess/efl/NetworkInfoProvider.cpp116
-rw-r--r--Source/WebKit2/UIProcess/efl/NetworkInfoProvider.h62
-rw-r--r--Source/WebKit2/UIProcess/efl/PageClientBase.cpp316
-rw-r--r--Source/WebKit2/UIProcess/efl/PageClientBase.h127
-rw-r--r--Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.cpp108
-rw-r--r--Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.h66
-rw-r--r--Source/WebKit2/UIProcess/efl/PageClientLegacyImpl.cpp91
-rw-r--r--Source/WebKit2/UIProcess/efl/PageClientLegacyImpl.h60
-rw-r--r--Source/WebKit2/UIProcess/efl/PageLoadClientEfl.cpp87
-rw-r--r--Source/WebKit2/UIProcess/efl/PageLoadClientEfl.h19
-rw-r--r--Source/WebKit2/UIProcess/efl/PagePolicyClientEfl.cpp122
-rw-r--r--Source/WebKit2/UIProcess/efl/PagePolicyClientEfl.h57
-rw-r--r--Source/WebKit2/UIProcess/efl/PageUIClientEfl.cpp168
-rw-r--r--Source/WebKit2/UIProcess/efl/PageUIClientEfl.h72
-rw-r--r--Source/WebKit2/UIProcess/efl/PageViewportControllerClientEfl.cpp125
-rw-r--r--Source/WebKit2/UIProcess/efl/PageViewportControllerClientEfl.h80
-rw-r--r--Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp96
-rw-r--r--Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h59
-rw-r--r--Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp37
-rw-r--r--Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h11
-rw-r--r--Source/WebKit2/UIProcess/efl/VibrationProvider.cpp117
-rw-r--r--Source/WebKit2/UIProcess/efl/VibrationProvider.h60
-rw-r--r--Source/WebKit2/UIProcess/efl/WebContextEfl.cpp3
-rw-r--r--Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp7
-rw-r--r--Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp13
-rw-r--r--Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp35
-rw-r--r--Source/WebKit2/UIProcess/efl/WebPopupMenuProxyEfl.cpp10
-rw-r--r--Source/WebKit2/UIProcess/efl/WebPopupMenuProxyEfl.h10
40 files changed, 3107 insertions, 72 deletions
diff --git a/Source/WebKit2/UIProcess/efl/BatteryProvider.cpp b/Source/WebKit2/UIProcess/efl/BatteryProvider.cpp
new file mode 100644
index 000000000..810711597
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/BatteryProvider.cpp
@@ -0,0 +1,106 @@
+/*
+ * 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 "BatteryProvider.h"
+
+#if ENABLE(BATTERY_STATUS)
+
+#include "WKAPICast.h"
+#include "WKBatteryManager.h"
+#include "WKBatteryStatus.h"
+#include "WKContext.h"
+
+using namespace WebCore;
+using namespace WebKit;
+
+static inline BatteryProvider* toBatteryProvider(const void* clientInfo)
+{
+ return static_cast<BatteryProvider*>(const_cast<void*>(clientInfo));
+}
+
+static void startUpdatingCallback(WKBatteryManagerRef, const void* clientInfo)
+{
+ toBatteryProvider(clientInfo)->startUpdating();
+}
+
+static void stopUpdatingCallback(WKBatteryManagerRef, const void* clientInfo)
+{
+ toBatteryProvider(clientInfo)->stopUpdating();
+}
+
+BatteryProvider::~BatteryProvider()
+{
+ m_provider.stopUpdating();
+
+ WKBatteryManagerRef wkBatteryManager = WKContextGetBatteryManager(m_wkContext.get());
+ ASSERT(wkBatteryManager);
+
+ WKBatteryManagerSetProvider(wkBatteryManager, 0);
+}
+
+PassRefPtr<BatteryProvider> BatteryProvider::create(WKContextRef wkContext)
+{
+ return adoptRef(new BatteryProvider(wkContext));
+}
+
+BatteryProvider::BatteryProvider(WKContextRef wkContext)
+ : m_wkContext(wkContext)
+ , m_provider(this)
+{
+ ASSERT(m_wkContext);
+
+ WKBatteryManagerRef wkBatteryManager = WKContextGetBatteryManager(m_wkContext.get());
+ ASSERT(wkBatteryManager);
+
+ WKBatteryProvider wkBatteryProvider = {
+ kWKBatteryProviderCurrentVersion,
+ this, // clientInfo
+ startUpdatingCallback,
+ stopUpdatingCallback
+ };
+ WKBatteryManagerSetProvider(wkBatteryManager, &wkBatteryProvider);
+}
+
+void BatteryProvider::startUpdating()
+{
+ m_provider.startUpdating();
+}
+
+void BatteryProvider::stopUpdating()
+{
+ m_provider.stopUpdating();
+}
+
+void BatteryProvider::didChangeBatteryStatus(const AtomicString& eventType, PassRefPtr<BatteryStatus> status)
+{
+ WKBatteryManagerRef wkBatteryManager = WKContextGetBatteryManager(m_wkContext.get());
+ ASSERT(wkBatteryManager);
+
+ WKRetainPtr<WKBatteryStatusRef> wkBatteryStatus(AdoptWK, WKBatteryStatusCreate(status->charging(), status->chargingTime(), status->dischargingTime(), status->level()));
+ WKBatteryManagerProviderDidChangeBatteryStatus(wkBatteryManager, toAPI(eventType.impl()), wkBatteryStatus.get());
+}
+
+#endif // ENABLE(BATTERY_STATUS)
diff --git a/Source/WebKit2/UIProcess/efl/BatteryProvider.h b/Source/WebKit2/UIProcess/efl/BatteryProvider.h
new file mode 100644
index 000000000..b829d7ed5
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/BatteryProvider.h
@@ -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.
+ */
+
+#ifndef BatteryProvider_h
+#define BatteryProvider_h
+
+#if ENABLE(BATTERY_STATUS)
+
+#include "BatteryProviderEfl.h"
+#include "BatteryProviderEflClient.h"
+#include "BatteryStatus.h"
+#include "WKRetainPtr.h"
+#include <WebKit2/WKBase.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+
+class BatteryProvider : public RefCounted<BatteryProvider>, public WebCore::BatteryProviderEflClient {
+public:
+ virtual ~BatteryProvider();
+ static PassRefPtr<BatteryProvider> create(WKContextRef);
+
+ void startUpdating();
+ void stopUpdating();
+
+private:
+ BatteryProvider(WKContextRef);
+
+ // BatteryProviderEflClient interface.
+ virtual void didChangeBatteryStatus(const AtomicString& eventType, PassRefPtr<WebCore::BatteryStatus>);
+
+ WKRetainPtr<WKContextRef> m_wkContext;
+ WebCore::BatteryProviderEfl m_provider;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(BATTERY_STATUS)
+
+#endif // BatteryProvider_h
diff --git a/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.cpp b/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.cpp
new file mode 100644
index 000000000..c008a6395
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.cpp
@@ -0,0 +1,144 @@
+/*
+ * 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 "ContextHistoryClientEfl.h"
+
+#include "DownloadProxy.h"
+#include "EwkViewImpl.h"
+#include "WKAPICast.h"
+#include "WKContext.h"
+#include "WKEinaSharedString.h"
+#include "WKString.h"
+#include "ewk_context_private.h"
+#include "ewk_navigation_data.h"
+#include "ewk_navigation_data_private.h"
+#include "ewk_url_response.h"
+#include "ewk_url_response_private.h"
+
+namespace WebKit {
+
+static inline const ContextHistoryClientEfl* toContextHistoryClientEfl(const void* clientInfo)
+{
+ ASSERT(clientInfo);
+ return static_cast<const ContextHistoryClientEfl*>(clientInfo);
+}
+
+void ContextHistoryClientEfl::didNavigateWithNavigationData(WKContextRef, WKPageRef page, WKNavigationDataRef navigationData, WKFrameRef, const void* clientInfo)
+{
+ const ContextHistoryClientEfl* historyClient = toContextHistoryClientEfl(clientInfo);
+
+ if (!historyClient->m_navigate)
+ return;
+
+ RefPtr<Ewk_Navigation_Data> navigationDataEwk = EwkNavigationData::create(navigationData);
+ historyClient->m_navigate(EwkViewImpl::viewFromPageViewMap(page), navigationDataEwk.get(), historyClient->m_userData);
+}
+
+void ContextHistoryClientEfl::didPerformClientRedirect(WKContextRef, WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef, const void* clientInfo)
+{
+ const ContextHistoryClientEfl* historyClient = toContextHistoryClientEfl(clientInfo);
+
+ if (!historyClient->m_clientRedirect)
+ return;
+
+ WKEinaSharedString sourceURLString(sourceURL);
+ WKEinaSharedString destinationURLString(destinationURL);
+
+ historyClient->m_clientRedirect(EwkViewImpl::viewFromPageViewMap(page), sourceURLString, destinationURLString, historyClient->m_userData);
+}
+
+void ContextHistoryClientEfl::didPerformServerRedirect(WKContextRef, WKPageRef page, WKURLRef sourceURL, WKURLRef destinationURL, WKFrameRef, const void* clientInfo)
+{
+ const ContextHistoryClientEfl* historyClient = toContextHistoryClientEfl(clientInfo);
+
+ if (!historyClient->m_serverRedirect)
+ return;
+
+ WKEinaSharedString sourceURLString(sourceURL);
+ WKEinaSharedString destinationURLString(destinationURL);
+
+ historyClient->m_serverRedirect(EwkViewImpl::viewFromPageViewMap(page), sourceURLString, destinationURLString, historyClient->m_userData);
+}
+
+void ContextHistoryClientEfl::didUpdateHistoryTitle(WKContextRef, WKPageRef page, WKStringRef title, WKURLRef URL, WKFrameRef, const void* clientInfo)
+{
+ const ContextHistoryClientEfl* historyClient = toContextHistoryClientEfl(clientInfo);
+
+ if (!historyClient->m_titleUpdated)
+ return;
+
+ WKEinaSharedString titleString(title);
+ WKEinaSharedString stringURL(URL);
+
+ historyClient->m_titleUpdated(EwkViewImpl::viewFromPageViewMap(page), titleString, stringURL, historyClient->m_userData);
+}
+
+void ContextHistoryClientEfl::populateVisitedLinks(WKContextRef, const void* clientInfo)
+{
+ const ContextHistoryClientEfl* historyClient = toContextHistoryClientEfl(clientInfo);
+
+ if (!historyClient->m_populateVisitedLinks)
+ return;
+
+ historyClient->m_populateVisitedLinks(historyClient->m_userData);
+}
+
+ContextHistoryClientEfl::ContextHistoryClientEfl(WKContextRef context)
+ : m_userData(0)
+ , m_navigate(0)
+ , m_clientRedirect(0)
+ , m_serverRedirect(0)
+ , m_titleUpdated(0)
+ , m_populateVisitedLinks(0)
+{
+ ASSERT(context);
+
+ WKContextHistoryClient wkHistoryClient;
+ memset(&wkHistoryClient, 0, sizeof(WKContextHistoryClient));
+
+ wkHistoryClient.version = kWKContextHistoryClientCurrentVersion;
+ wkHistoryClient.clientInfo = this;
+
+ wkHistoryClient.didNavigateWithNavigationData = didNavigateWithNavigationData;
+ wkHistoryClient.didPerformClientRedirect = didPerformClientRedirect;
+ wkHistoryClient.didPerformServerRedirect = didPerformServerRedirect;
+ wkHistoryClient.didUpdateHistoryTitle = didUpdateHistoryTitle;
+ wkHistoryClient.populateVisitedLinks = populateVisitedLinks;
+
+ WKContextSetHistoryClient(context, &wkHistoryClient);
+}
+
+void ContextHistoryClientEfl::setCallbacks(Ewk_History_Navigation_Cb navigate, Ewk_History_Client_Redirection_Cb clientRedirect, Ewk_History_Server_Redirection_Cb serverRedirect, Ewk_History_Title_Update_Cb titleUpdate, Ewk_History_Populate_Visited_Links_Cb populateVisitedLinks, void* data)
+{
+ m_navigate = navigate;
+ m_clientRedirect = clientRedirect;
+ m_serverRedirect = serverRedirect;
+ m_titleUpdated = titleUpdate;
+ m_populateVisitedLinks = populateVisitedLinks;
+ m_userData = data;
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.h b/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.h
new file mode 100644
index 000000000..32032565a
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/ContextHistoryClientEfl.h
@@ -0,0 +1,63 @@
+/*
+ * 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 ContextHistoryClientEfl_h
+#define ContextHistoryClientEfl_h
+
+#include "ewk_context.h"
+#include <WebKit2/WKBase.h>
+#include <wtf/PassOwnPtr.h>
+
+namespace WebKit {
+
+class ContextHistoryClientEfl {
+public:
+ static PassOwnPtr<ContextHistoryClientEfl> create(WKContextRef context)
+ {
+ return adoptPtr(new ContextHistoryClientEfl(context));
+ }
+
+ void setCallbacks(Ewk_History_Navigation_Cb, Ewk_History_Client_Redirection_Cb, Ewk_History_Server_Redirection_Cb, Ewk_History_Title_Update_Cb, Ewk_History_Populate_Visited_Links_Cb, void*);
+
+private:
+ explicit ContextHistoryClientEfl(WKContextRef);
+
+ static void didNavigateWithNavigationData(WKContextRef, WKPageRef, WKNavigationDataRef, WKFrameRef, const void*);
+ static void didPerformClientRedirect(WKContextRef, WKPageRef, WKURLRef sourceURL, WKURLRef, WKFrameRef, const void*);
+ static void didPerformServerRedirect(WKContextRef, WKPageRef, WKURLRef sourceURL, WKURLRef, WKFrameRef, const void*);
+ static void didUpdateHistoryTitle(WKContextRef, WKPageRef, WKStringRef, WKURLRef, WKFrameRef, const void*);
+ static void populateVisitedLinks(WKContextRef, const void*);
+
+ void* m_userData;
+ Ewk_History_Navigation_Cb m_navigate;
+ Ewk_History_Client_Redirection_Cb m_clientRedirect;
+ Ewk_History_Server_Redirection_Cb m_serverRedirect;
+ Ewk_History_Title_Update_Cb m_titleUpdated;
+ Ewk_History_Populate_Visited_Links_Cb m_populateVisitedLinks;
+};
+
+} // namespace WebKit
+
+#endif // ContextHistoryClientEfl_h
diff --git a/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.cpp b/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.cpp
new file mode 100644
index 000000000..869e44f3a
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.cpp
@@ -0,0 +1,162 @@
+/*
+ * 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 "DownloadManagerEfl.h"
+
+#include "DownloadProxy.h"
+#include "EwkViewImpl.h"
+#include "WKContext.h"
+#include "WKString.h"
+#include "ewk_context_private.h"
+#include "ewk_error_private.h"
+#include "ewk_view.h"
+
+using namespace EwkViewCallbacks;
+
+namespace WebKit {
+
+static inline DownloadManagerEfl* toDownloadManagerEfl(const void* clientInfo)
+{
+ return static_cast<DownloadManagerEfl*>(const_cast<void*>(clientInfo));
+}
+
+WKStringRef DownloadManagerEfl::decideDestinationWithSuggestedFilename(WKContextRef, WKDownloadRef wkDownload, WKStringRef filename, bool* /*allowOverwrite*/, const void* clientInfo)
+{
+ EwkDownloadJob* download = toDownloadManagerEfl(clientInfo)->downloadJob(toImpl(wkDownload)->downloadID());
+ ASSERT(download);
+
+ download->setSuggestedFileName(toImpl(filename)->string().utf8().data());
+
+ // We send the new download signal on the Ewk_View only once we have received the response
+ // and the suggested file name.
+ download->viewImpl()->smartCallback<DownloadJobRequested>().call(download);
+
+ // DownloadSoup expects the destination to be a URL.
+ String destination = ASCIILiteral("file://") + String::fromUTF8(download->destination());
+
+ return WKStringCreateWithUTF8CString(destination.utf8().data());
+}
+
+void DownloadManagerEfl::didReceiveResponse(WKContextRef, WKDownloadRef wkDownload, WKURLResponseRef wkResponse, const void* clientInfo)
+{
+ EwkDownloadJob* download = toDownloadManagerEfl(clientInfo)->downloadJob(toImpl(wkDownload)->downloadID());
+ ASSERT(download);
+ download->setResponse(EwkUrlResponse::create(wkResponse));
+}
+
+void DownloadManagerEfl::didCreateDestination(WKContextRef, WKDownloadRef wkDownload, WKStringRef /*path*/, const void* clientInfo)
+{
+ EwkDownloadJob* download = toDownloadManagerEfl(clientInfo)->downloadJob(toImpl(wkDownload)->downloadID());
+ ASSERT(download);
+
+ download->setState(EWK_DOWNLOAD_JOB_STATE_DOWNLOADING);
+}
+
+void DownloadManagerEfl::didReceiveData(WKContextRef, WKDownloadRef wkDownload, uint64_t length, const void* clientInfo)
+{
+ EwkDownloadJob* download = toDownloadManagerEfl(clientInfo)->downloadJob(toImpl(wkDownload)->downloadID());
+ ASSERT(download);
+ download->incrementReceivedData(length);
+}
+
+void DownloadManagerEfl::didFail(WKContextRef, WKDownloadRef wkDownload, WKErrorRef error, const void* clientInfo)
+{
+ DownloadManagerEfl* downloadManager = toDownloadManagerEfl(clientInfo);
+ uint64_t downloadId = toImpl(wkDownload)->downloadID();
+ EwkDownloadJob* download = downloadManager->downloadJob(downloadId);
+ ASSERT(download);
+
+ OwnPtr<Ewk_Error> ewkError = Ewk_Error::create(error);
+ download->setState(EWK_DOWNLOAD_JOB_STATE_FAILED);
+ Ewk_Download_Job_Error downloadError = { download, ewkError.get() };
+ download->viewImpl()->smartCallback<DownloadJobFailed>().call(&downloadError);
+ downloadManager->unregisterDownloadJob(downloadId);
+}
+
+void DownloadManagerEfl::didCancel(WKContextRef, WKDownloadRef wkDownload, const void* clientInfo)
+{
+ DownloadManagerEfl* downloadManager = toDownloadManagerEfl(clientInfo);
+ uint64_t downloadId = toImpl(wkDownload)->downloadID();
+ EwkDownloadJob* download = downloadManager->downloadJob(downloadId);
+ ASSERT(download);
+
+ download->setState(EWK_DOWNLOAD_JOB_STATE_CANCELLED);
+ download->viewImpl()->smartCallback<DownloadJobCancelled>().call(download);
+ downloadManager->unregisterDownloadJob(downloadId);
+}
+
+void DownloadManagerEfl::didFinish(WKContextRef, WKDownloadRef wkDownload, const void* clientInfo)
+{
+ DownloadManagerEfl* downloadManager = toDownloadManagerEfl(clientInfo);
+ uint64_t downloadId = toImpl(wkDownload)->downloadID();
+ EwkDownloadJob* download = downloadManager->downloadJob(downloadId);
+ ASSERT(download);
+
+ download->setState(EWK_DOWNLOAD_JOB_STATE_FINISHED);
+ download->viewImpl()->smartCallback<DownloadJobFinished>().call(download);
+ downloadManager->unregisterDownloadJob(downloadId);
+}
+
+DownloadManagerEfl::DownloadManagerEfl(EwkContext* context)
+ : m_context(context)
+{
+ WKContextDownloadClient wkDownloadClient;
+ memset(&wkDownloadClient, 0, sizeof(WKContextDownloadClient));
+
+ wkDownloadClient.version = kWKContextDownloadClientCurrentVersion;
+ wkDownloadClient.clientInfo = this;
+ wkDownloadClient.didCancel = didCancel;
+ wkDownloadClient.decideDestinationWithSuggestedFilename = decideDestinationWithSuggestedFilename;
+ wkDownloadClient.didCreateDestination = didCreateDestination;
+ wkDownloadClient.didReceiveResponse = didReceiveResponse;
+ wkDownloadClient.didReceiveData = didReceiveData;
+ wkDownloadClient.didFail = didFail;
+ wkDownloadClient.didFinish = didFinish;
+
+ WKContextSetDownloadClient(context->wkContext(), &wkDownloadClient);
+}
+
+void DownloadManagerEfl::registerDownload(DownloadProxy* download, EwkViewImpl* viewImpl)
+{
+ uint64_t downloadId = download->downloadID();
+ if (m_downloadJobs.contains(downloadId))
+ return;
+
+ RefPtr<EwkDownloadJob> ewkDownload = EwkDownloadJob::create(download, viewImpl);
+ m_downloadJobs.add(downloadId, ewkDownload);
+}
+
+EwkDownloadJob* DownloadManagerEfl::downloadJob(uint64_t id) const
+{
+ return m_downloadJobs.get(id).get();
+}
+
+void DownloadManagerEfl::unregisterDownloadJob(uint64_t id)
+{
+ m_downloadJobs.remove(id);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.h b/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.h
new file mode 100644
index 000000000..dfc627a62
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/DownloadManagerEfl.h
@@ -0,0 +1,68 @@
+/*
+ * 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 DownloadManagerEfl_h
+#define DownloadManagerEfl_h
+
+#include "ewk_download_job_private.h"
+#include <wtf/HashMap.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/RefPtr.h>
+
+class EwkContext;
+class EwkDownloadJob;
+
+namespace WebKit {
+
+class DownloadManagerEfl {
+public:
+ static PassOwnPtr<DownloadManagerEfl> create(EwkContext* context)
+ {
+ return adoptPtr(new DownloadManagerEfl(context));
+ }
+
+ void registerDownload(DownloadProxy*, EwkViewImpl*);
+
+private:
+ DownloadManagerEfl(EwkContext*);
+
+ EwkDownloadJob* downloadJob(uint64_t id) const;
+ void unregisterDownloadJob(uint64_t id);
+
+ static WKStringRef decideDestinationWithSuggestedFilename(WKContextRef, WKDownloadRef, WKStringRef filename, bool* allowOverwrite, const void* clientInfo);
+ static void didReceiveResponse(WKContextRef, WKDownloadRef, WKURLResponseRef, const void* clientInfo);
+ static void didCreateDestination(WKContextRef, WKDownloadRef, WKStringRef path, const void* clientInfo);
+ static void didReceiveData(WKContextRef, WKDownloadRef, uint64_t length, const void* clientInfo);
+ static void didFail(WKContextRef, WKDownloadRef, WKErrorRef, const void* clientInfo);
+ static void didCancel(WKContextRef, WKDownloadRef, const void* clientInfo);
+ static void didFinish(WKContextRef, WKDownloadRef, const void* clientInfo);
+
+ EwkContext* m_context;
+ HashMap<uint64_t, RefPtr<EwkDownloadJob> > m_downloadJobs;
+};
+
+} // namespace WebKit
+
+#endif // DownloadManagerEfl_h
diff --git a/Source/WebKit2/UIProcess/efl/FindClientEfl.cpp b/Source/WebKit2/UIProcess/efl/FindClientEfl.cpp
new file mode 100644
index 000000000..5b2e88ea2
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/FindClientEfl.cpp
@@ -0,0 +1,71 @@
+/*
+ * 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 "EwkViewImpl.h"
+#include "WKPage.h"
+
+using namespace EwkViewCallbacks;
+
+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);
+ findClient->m_viewImpl->smartCallback<TextFound>().call(&matchCount);
+}
+
+void FindClientEfl::didFailToFindString(WKPageRef, WKStringRef, const void* clientInfo)
+{
+ FindClientEfl* findClient = toFindClientEfl(clientInfo);
+ unsigned matchCount = 0;
+ findClient->m_viewImpl->smartCallback<TextFound>().call(&matchCount);
+}
+
+FindClientEfl::FindClientEfl(EwkViewImpl* viewImpl)
+ : m_viewImpl(viewImpl)
+{
+ WKPageRef pageRef = m_viewImpl->wkPage();
+ 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
diff --git a/Source/WebKit2/UIProcess/efl/FindClientEfl.h b/Source/WebKit2/UIProcess/efl/FindClientEfl.h
new file mode 100644
index 000000000..274460b1a
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/FindClientEfl.h
@@ -0,0 +1,55 @@
+/*
+ * 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>
+
+class EwkViewImpl;
+
+namespace WebKit {
+
+class FindClientEfl {
+public:
+ static PassOwnPtr<FindClientEfl> create(EwkViewImpl* viewImpl)
+ {
+ return adoptPtr(new FindClientEfl(viewImpl));
+ }
+
+private:
+ explicit FindClientEfl(EwkViewImpl*);
+
+ static void didFindString(WKPageRef, WKStringRef, unsigned matchCount, const void* clientInfo);
+ static void didFailToFindString(WKPageRef, WKStringRef, const void* clientInfo);
+
+ EwkViewImpl* m_viewImpl;
+};
+
+} // namespace WebKit
+
+#endif // FindClientEfl_h
diff --git a/Source/WebKit2/UIProcess/efl/FormClientEfl.cpp b/Source/WebKit2/UIProcess/efl/FormClientEfl.cpp
new file mode 100644
index 000000000..5b893092d
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/FormClientEfl.cpp
@@ -0,0 +1,64 @@
+/*
+ * 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 "EwkViewImpl.h"
+#include "WKPage.h"
+#include "ewk_form_submission_request_private.h"
+
+using namespace EwkViewCallbacks;
+
+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);
+ formClient->m_viewImpl->smartCallback<NewFormSubmissionRequest>().call(request.get());
+}
+
+FormClientEfl::FormClientEfl(EwkViewImpl* viewImpl)
+ : m_viewImpl(viewImpl)
+{
+ WKPageRef pageRef = m_viewImpl->wkPage();
+ ASSERT(pageRef);
+
+ WKPageFormClient formClient;
+ memset(&formClient, 0, sizeof(WKPageFormClient));
+ formClient.version = kWKPageFormClientCurrentVersion;
+ formClient.clientInfo = this;
+ formClient.willSubmitForm = willSubmitForm;
+ WKPageSetPageFormClient(pageRef, &formClient);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/FormClientEfl.h b/Source/WebKit2/UIProcess/efl/FormClientEfl.h
new file mode 100644
index 000000000..66e060c14
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/FormClientEfl.h
@@ -0,0 +1,53 @@
+/*
+ * 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>
+
+class EwkViewImpl;
+
+namespace WebKit {
+
+class FormClientEfl {
+public:
+ static PassOwnPtr<FormClientEfl> create(EwkViewImpl* viewImpl)
+ {
+ return adoptPtr(new FormClientEfl(viewImpl));
+ }
+
+private:
+ explicit FormClientEfl(EwkViewImpl*);
+
+ static void willSubmitForm(WKPageRef, WKFrameRef, WKFrameRef, WKDictionaryRef values, WKTypeRef userData, WKFormSubmissionListenerRef, const void* clientInfo);
+
+ EwkViewImpl* m_viewImpl;
+};
+
+} // namespace WebKit
+
+#endif // FormClientEfl_h
diff --git a/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp b/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp
new file mode 100644
index 000000000..531e3bead
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.cpp
@@ -0,0 +1,132 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * 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 library 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 library; see the file COPYING.LIB. If not, write to
+ * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ */
+
+#include "config.h"
+#include "InputMethodContextEfl.h"
+
+#include "EwkViewImpl.h"
+#include "WebPageProxy.h"
+#include <Ecore_Evas.h>
+#include <Ecore_IMF_Evas.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+InputMethodContextEfl::InputMethodContextEfl(EwkViewImpl* viewImpl, PassOwnPtr<Ecore_IMF_Context> context)
+ : m_viewImpl(viewImpl)
+ , m_context(context)
+ , m_focused(false)
+{
+ ASSERT(m_context);
+ ecore_imf_context_event_callback_add(m_context.get(), ECORE_IMF_CALLBACK_PREEDIT_CHANGED, onIMFPreeditSequenceChanged, this);
+ ecore_imf_context_event_callback_add(m_context.get(), ECORE_IMF_CALLBACK_COMMIT, onIMFInputSequenceComplete, this);
+}
+
+InputMethodContextEfl::~InputMethodContextEfl()
+{
+}
+
+void InputMethodContextEfl::onIMFInputSequenceComplete(void* data, Ecore_IMF_Context*, void* eventInfo)
+{
+ InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
+ if (!eventInfo || !inputMethodContext->m_focused)
+ return;
+
+ inputMethodContext->m_viewImpl->page()->confirmComposition(String::fromUTF8(static_cast<char*>(eventInfo)));
+}
+
+void InputMethodContextEfl::onIMFPreeditSequenceChanged(void* data, Ecore_IMF_Context* context, void*)
+{
+ InputMethodContextEfl* inputMethodContext = static_cast<InputMethodContextEfl*>(data);
+
+ if (!inputMethodContext->m_viewImpl->page()->focusedFrame() || !inputMethodContext->m_focused)
+ return;
+
+ char* buffer = 0;
+ ecore_imf_context_preedit_string_get(context, &buffer, 0);
+ if (!buffer)
+ return;
+
+ String preeditString = String::fromUTF8(buffer);
+ free(buffer);
+ Vector<CompositionUnderline> underlines;
+ underlines.append(CompositionUnderline(0, preeditString.length(), Color(0, 0, 0), false));
+ inputMethodContext->m_viewImpl->page()->setComposition(preeditString, underlines, 0);
+}
+
+PassOwnPtr<Ecore_IMF_Context> InputMethodContextEfl::createIMFContext(Evas* canvas)
+{
+ const char* defaultContextID = ecore_imf_context_default_id_get();
+ if (!defaultContextID)
+ return nullptr;
+
+ OwnPtr<Ecore_IMF_Context> imfContext = adoptPtr(ecore_imf_context_add(defaultContextID));
+ if (!imfContext)
+ return nullptr;
+
+ Ecore_Evas* ecoreEvas = ecore_evas_ecore_evas_get(canvas);
+ ecore_imf_context_client_window_set(imfContext.get(), reinterpret_cast<void*>(ecore_evas_window_get(ecoreEvas)));
+ ecore_imf_context_client_canvas_set(imfContext.get(), canvas);
+
+ return imfContext.release();
+}
+
+void InputMethodContextEfl::handleMouseUpEvent(const Evas_Event_Mouse_Up*)
+{
+ ecore_imf_context_reset(m_context.get());
+}
+
+void InputMethodContextEfl::handleKeyDownEvent(const Evas_Event_Key_Down* downEvent, bool* isFiltered)
+{
+ Ecore_IMF_Event inputMethodEvent;
+ ecore_imf_evas_event_key_down_wrap(const_cast<Evas_Event_Key_Down*>(downEvent), &inputMethodEvent.key_down);
+
+ *isFiltered = ecore_imf_context_filter_event(m_context.get(), ECORE_IMF_EVENT_KEY_DOWN, &inputMethodEvent);
+}
+
+void InputMethodContextEfl::updateTextInputState()
+{
+ if (!m_context)
+ return;
+
+ const EditorState& editor = m_viewImpl->page()->editorState();
+
+ if (editor.isContentEditable) {
+ if (m_focused)
+ return;
+
+ ecore_imf_context_reset(m_context.get());
+ ecore_imf_context_focus_in(m_context.get());
+ m_focused = true;
+ } else {
+ if (!m_focused)
+ return;
+
+ if (editor.hasComposition)
+ m_viewImpl->page()->cancelComposition();
+
+ m_focused = false;
+ ecore_imf_context_reset(m_context.get());
+ ecore_imf_context_focus_out(m_context.get());
+ }
+}
+
+}
diff --git a/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.h b/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.h
new file mode 100644
index 000000000..aaf51b936
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/InputMethodContextEfl.h
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * Copyright (C) 2012 Intel Corporation. All rights reserved.
+ *
+ * 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 library 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 library; 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 InputMethodContextEfl_h
+#define InputMethodContextEfl_h
+
+#include <Ecore_IMF.h>
+#include <Evas.h>
+#include <wtf/OwnPtr.h>
+#include <wtf/PassOwnPtr.h>
+
+class EwkViewImpl;
+
+namespace WebKit {
+
+class WebPageProxy;
+
+class InputMethodContextEfl {
+public:
+ static PassOwnPtr<InputMethodContextEfl> create(EwkViewImpl* viewImpl, Evas* canvas)
+ {
+ OwnPtr<Ecore_IMF_Context> context = createIMFContext(canvas);
+ if (!context)
+ return nullptr;
+
+ return adoptPtr(new InputMethodContextEfl(viewImpl, context.release()));
+ }
+ ~InputMethodContextEfl();
+
+ void handleMouseUpEvent(const Evas_Event_Mouse_Up* upEvent);
+ void handleKeyDownEvent(const Evas_Event_Key_Down* downEvent, bool* isFiltered);
+ void updateTextInputState();
+
+private:
+ InputMethodContextEfl(EwkViewImpl*, PassOwnPtr<Ecore_IMF_Context>);
+
+ static PassOwnPtr<Ecore_IMF_Context> createIMFContext(Evas* canvas);
+ static void onIMFInputSequenceComplete(void* data, Ecore_IMF_Context*, void* eventInfo);
+ static void onIMFPreeditSequenceChanged(void* data, Ecore_IMF_Context*, void* eventInfo);
+
+ EwkViewImpl* m_viewImpl;
+ OwnPtr<Ecore_IMF_Context> m_context;
+ bool m_focused;
+};
+
+} // namespace WebKit
+
+#endif // InputMethodContextEfl_h
diff --git a/Source/WebKit2/UIProcess/efl/NetworkInfoProvider.cpp b/Source/WebKit2/UIProcess/efl/NetworkInfoProvider.cpp
new file mode 100644
index 000000000..f5456f9b8
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/NetworkInfoProvider.cpp
@@ -0,0 +1,116 @@
+/*
+ * 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 "NetworkInfoProvider.h"
+
+#if ENABLE(NETWORK_INFO)
+
+#include "WKContext.h"
+#include "WKNetworkInfoManager.h"
+#include <NotImplemented.h>
+
+using namespace WebKit;
+
+static inline NetworkInfoProvider* toNetworkInfoProvider(const void* clientInfo)
+{
+ return static_cast<NetworkInfoProvider*>(const_cast<void*>(clientInfo));
+}
+
+static void startUpdatingCallback(WKNetworkInfoManagerRef, const void* clientInfo)
+{
+ toNetworkInfoProvider(clientInfo)->startUpdating();
+}
+
+static void stopUpdatingCallback(WKNetworkInfoManagerRef, const void* clientInfo)
+{
+ toNetworkInfoProvider(clientInfo)->stopUpdating();
+}
+
+static double getBandwidthCallback(WKNetworkInfoManagerRef, const void* clientInfo)
+{
+ return toNetworkInfoProvider(clientInfo)->bandwidth();
+}
+
+static bool isMeteredCallback(WKNetworkInfoManagerRef, const void* clientInfo)
+{
+ return toNetworkInfoProvider(clientInfo)->metered();
+}
+
+PassRefPtr<NetworkInfoProvider> NetworkInfoProvider::create(WKContextRef wkContext)
+{
+ return adoptRef(new NetworkInfoProvider(wkContext));
+}
+
+NetworkInfoProvider::NetworkInfoProvider(WKContextRef wkContext)
+ : m_wkContext(wkContext)
+{
+ ASSERT(wkContext);
+
+ WKNetworkInfoManagerRef wkNetworkInfoManager = WKContextGetNetworkInfoManager(m_wkContext.get());
+ ASSERT(wkNetworkInfoManager);
+
+ WKNetworkInfoProvider wkNetworkInfoProvider = {
+ kWKNetworkInfoProviderCurrentVersion,
+ this, // clientInfo
+ startUpdatingCallback,
+ stopUpdatingCallback,
+ getBandwidthCallback,
+ isMeteredCallback
+ };
+ WKNetworkInfoManagerSetProvider(wkNetworkInfoManager, &wkNetworkInfoProvider);
+}
+
+NetworkInfoProvider::~NetworkInfoProvider()
+{
+ WKNetworkInfoManagerRef wkNetworkInfoManager = WKContextGetNetworkInfoManager(m_wkContext.get());
+ ASSERT(wkNetworkInfoManager);
+
+ WKNetworkInfoManagerSetProvider(wkNetworkInfoManager, 0);
+}
+
+double NetworkInfoProvider::bandwidth() const
+{
+ return m_provider.bandwidth();
+}
+
+bool NetworkInfoProvider::metered() const
+{
+ notImplemented();
+
+ return false;
+}
+
+void NetworkInfoProvider::startUpdating()
+{
+ m_provider.startUpdating();
+}
+
+void NetworkInfoProvider::stopUpdating()
+{
+ m_provider.stopUpdating();
+}
+
+#endif // ENABLE(NETWORK_INFO)
diff --git a/Source/WebKit2/UIProcess/efl/NetworkInfoProvider.h b/Source/WebKit2/UIProcess/efl/NetworkInfoProvider.h
new file mode 100644
index 000000000..57631193f
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/NetworkInfoProvider.h
@@ -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.
+ */
+
+#ifndef NetworkInfoProvider_h
+#define NetworkInfoProvider_h
+
+#if ENABLE(NETWORK_INFO)
+
+#include <NetworkInfoClient.h>
+#include <NetworkInfoProviderEfl.h>
+#include <WebKit2/WKBase.h>
+#include <WebKit2/WKRetainPtr.h>
+#include <wtf/PassRefPtr.h>
+
+namespace WebKit {
+
+class NetworkInfoProvider : public RefCounted<NetworkInfoProvider>, public WebCore::NetworkInfoClient {
+public:
+ virtual ~NetworkInfoProvider();
+ static PassRefPtr<NetworkInfoProvider> create(WKContextRef);
+
+ // NetworkInfoClient interface.
+ virtual double bandwidth() const;
+ virtual bool metered() const;
+
+ virtual void startUpdating();
+ virtual void stopUpdating();
+
+private:
+ NetworkInfoProvider(WKContextRef);
+
+ WKRetainPtr<WKContextRef> m_wkContext;
+ WebCore::NetworkInfoProviderEfl m_provider;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(NETWORK_INFO)
+
+#endif // NetworkInfoProvider_h
diff --git a/Source/WebKit2/UIProcess/efl/PageClientBase.cpp b/Source/WebKit2/UIProcess/efl/PageClientBase.cpp
new file mode 100644
index 000000000..b597d29e0
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PageClientBase.cpp
@@ -0,0 +1,316 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * 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 "PageClientBase.h"
+
+#include "DrawingAreaProxyImpl.h"
+#include "EwkViewImpl.h"
+#include "InputMethodContextEfl.h"
+#include "NativeWebKeyboardEvent.h"
+#include "NotImplemented.h"
+#include "WebContext.h"
+#include "WebContextMenuProxy.h"
+#include "WebPageGroup.h"
+#include "WebPageProxy.h"
+#include "WebPopupMenuProxyEfl.h"
+#include "WebPreferences.h"
+#include "ewk_context.h"
+#include "ewk_context_private.h"
+#include "ewk_download_job.h"
+#include "ewk_download_job_private.h"
+#include "ewk_private.h"
+#include "ewk_view.h"
+
+using namespace WebCore;
+using namespace EwkViewCallbacks;
+
+namespace WebKit {
+
+PageClientBase::PageClientBase(EwkViewImpl* viewImpl)
+ : m_viewImpl(viewImpl)
+{
+}
+
+PageClientBase::~PageClientBase()
+{
+}
+
+EwkViewImpl* PageClientBase::viewImpl() const
+{
+ return m_viewImpl;
+}
+
+// PageClient
+PassOwnPtr<DrawingAreaProxy> PageClientBase::createDrawingAreaProxy()
+{
+ return DrawingAreaProxyImpl::create(m_viewImpl->page());
+}
+
+void PageClientBase::setViewNeedsDisplay(const WebCore::IntRect& rect)
+{
+ m_viewImpl->update(rect);
+}
+
+void PageClientBase::displayView()
+{
+ notImplemented();
+}
+
+void PageClientBase::scrollView(const WebCore::IntRect& scrollRect, const WebCore::IntSize&)
+{
+ setViewNeedsDisplay(scrollRect);
+}
+
+WebCore::IntSize PageClientBase::viewSize()
+{
+ return m_viewImpl->size();
+}
+
+bool PageClientBase::isViewWindowActive()
+{
+ notImplemented();
+ return true;
+}
+
+bool PageClientBase::isViewFocused()
+{
+ return m_viewImpl->isFocused();
+}
+
+bool PageClientBase::isViewVisible()
+{
+ return m_viewImpl->isVisible();
+}
+
+bool PageClientBase::isViewInWindow()
+{
+ notImplemented();
+ return true;
+}
+
+void PageClientBase::processDidCrash()
+{
+ // Check if loading was ongoing, when web process crashed.
+ double loadProgress = ewk_view_load_progress_get(m_viewImpl->view());
+ if (loadProgress >= 0 && loadProgress < 1) {
+ loadProgress = 1;
+ m_viewImpl->smartCallback<LoadProgress>().call(&loadProgress);
+ }
+
+ bool handled = false;
+ m_viewImpl->smartCallback<WebProcessCrashed>().call(&handled);
+
+ if (!handled) {
+ CString url = m_viewImpl->page()->urlAtProcessExit().utf8();
+ WARN("WARNING: The web process experienced a crash on '%s'.\n", url.data());
+
+ // Display an error page
+ ewk_view_html_string_load(m_viewImpl->view(), "The web process has crashed.", 0, url.data());
+ }
+}
+
+void PageClientBase::didRelaunchProcess()
+{
+ const char* themePath = m_viewImpl->themePath();
+ if (themePath)
+ m_viewImpl->page()->setThemePath(themePath);
+}
+
+void PageClientBase::pageClosed()
+{
+ notImplemented();
+}
+
+void PageClientBase::toolTipChanged(const String&, const String& newToolTip)
+{
+ if (newToolTip.isEmpty())
+ m_viewImpl->smartCallback<TooltipTextUnset>().call();
+ else
+ m_viewImpl->smartCallback<TooltipTextSet>().call(newToolTip);
+}
+
+void PageClientBase::setCursor(const Cursor& cursor)
+{
+ m_viewImpl->setCursor(cursor);
+}
+
+void PageClientBase::setCursorHiddenUntilMouseMoves(bool)
+{
+ notImplemented();
+}
+
+void PageClientBase::registerEditCommand(PassRefPtr<WebEditCommandProxy> command, WebPageProxy::UndoOrRedo undoOrRedo)
+{
+ m_undoController.registerEditCommand(command, undoOrRedo);
+}
+
+void PageClientBase::clearAllEditCommands()
+{
+ m_undoController.clearAllEditCommands();
+}
+
+bool PageClientBase::canUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
+{
+ return m_undoController.canUndoRedo(undoOrRedo);
+}
+
+void PageClientBase::executeUndoRedo(WebPageProxy::UndoOrRedo undoOrRedo)
+{
+ m_undoController.executeUndoRedo(undoOrRedo);
+}
+
+FloatRect PageClientBase::convertToDeviceSpace(const FloatRect& viewRect)
+{
+ notImplemented();
+ return viewRect;
+}
+
+FloatRect PageClientBase::convertToUserSpace(const FloatRect& viewRect)
+{
+ notImplemented();
+ return viewRect;
+}
+
+IntPoint PageClientBase::screenToWindow(const IntPoint& point)
+{
+ notImplemented();
+ return point;
+}
+
+IntRect PageClientBase::windowToScreen(const IntRect&)
+{
+ notImplemented();
+ return IntRect();
+}
+
+void PageClientBase::doneWithKeyEvent(const NativeWebKeyboardEvent&, bool)
+{
+ notImplemented();
+}
+
+#if ENABLE(TOUCH_EVENTS)
+void PageClientBase::doneWithTouchEvent(const NativeWebTouchEvent&, bool /*wasEventHandled*/)
+{
+ notImplemented();
+}
+#endif
+
+PassRefPtr<WebPopupMenuProxy> PageClientBase::createPopupMenuProxy(WebPageProxy* page)
+{
+ return WebPopupMenuProxyEfl::create(m_viewImpl, page);
+}
+
+PassRefPtr<WebContextMenuProxy> PageClientBase::createContextMenuProxy(WebPageProxy*)
+{
+ notImplemented();
+ return 0;
+}
+
+#if ENABLE(INPUT_TYPE_COLOR)
+PassRefPtr<WebColorChooserProxy> PageClientBase::createColorChooserProxy(WebPageProxy*, const WebCore::Color&, const WebCore::IntRect&)
+{
+ notImplemented();
+ return 0;
+}
+#endif
+
+void PageClientBase::setFindIndicator(PassRefPtr<FindIndicator>, bool, bool)
+{
+ notImplemented();
+}
+
+#if USE(ACCELERATED_COMPOSITING)
+void PageClientBase::enterAcceleratedCompositingMode(const LayerTreeContext&)
+{
+ m_viewImpl->enterAcceleratedCompositingMode();
+}
+
+void PageClientBase::exitAcceleratedCompositingMode()
+{
+ m_viewImpl->exitAcceleratedCompositingMode();
+}
+
+void PageClientBase::updateAcceleratedCompositingMode(const LayerTreeContext&)
+{
+ notImplemented();
+}
+#endif // USE(ACCELERATED_COMPOSITING)
+
+void PageClientBase::didChangeScrollbarsForMainFrame() const
+{
+ notImplemented();
+}
+
+void PageClientBase::didCommitLoadForMainFrame(bool)
+{
+ notImplemented();
+}
+
+void PageClientBase::didFinishLoadingDataForCustomRepresentation(const String&, const CoreIPC::DataReference&)
+{
+ notImplemented();
+}
+
+double PageClientBase::customRepresentationZoomFactor()
+{
+ notImplemented();
+ return 0;
+}
+
+void PageClientBase::setCustomRepresentationZoomFactor(double)
+{
+ notImplemented();
+}
+
+void PageClientBase::flashBackingStoreUpdates(const Vector<IntRect>&)
+{
+ notImplemented();
+}
+
+void PageClientBase::findStringInCustomRepresentation(const String&, FindOptions, unsigned)
+{
+ notImplemented();
+}
+
+void PageClientBase::countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned)
+{
+ notImplemented();
+}
+
+void PageClientBase::updateTextInputState()
+{
+ InputMethodContextEfl* inputMethodContext = m_viewImpl->inputMethodContext();
+ if (inputMethodContext)
+ inputMethodContext->updateTextInputState();
+}
+
+void PageClientBase::handleDownloadRequest(DownloadProxy* download)
+{
+ EwkContext* context = m_viewImpl->ewkContext();
+ context->downloadManager()->registerDownload(download, m_viewImpl);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/PageClientBase.h b/Source/WebKit2/UIProcess/efl/PageClientBase.h
new file mode 100644
index 000000000..6ea7405e8
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PageClientBase.h
@@ -0,0 +1,127 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ *
+ * 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 PageClientBase_h
+#define PageClientBase_h
+
+#include "DefaultUndoController.h"
+#include "PageClient.h"
+#include <Evas.h>
+
+class EwkViewImpl;
+
+namespace WebKit {
+
+class PageClientBase : public PageClient {
+public:
+ virtual ~PageClientBase();
+
+ // Called from the view
+ virtual void didCommitLoad() = 0;
+ virtual void updateViewportSize(const WebCore::IntSize&) = 0;
+ virtual void didChangeContentsSize(const WebCore::IntSize&) = 0;
+
+ EwkViewImpl* viewImpl() const;
+
+protected:
+ explicit PageClientBase(EwkViewImpl*);
+
+ // PageClient
+ virtual PassOwnPtr<DrawingAreaProxy> createDrawingAreaProxy();
+ virtual void setViewNeedsDisplay(const WebCore::IntRect&);
+ virtual void displayView();
+ virtual void scrollView(const WebCore::IntRect&, const WebCore::IntSize&);
+ virtual WebCore::IntSize viewSize();
+ virtual bool isViewWindowActive();
+ virtual bool isViewFocused();
+ virtual bool isViewVisible();
+ virtual bool isViewInWindow();
+
+ virtual void processDidCrash();
+ virtual void didRelaunchProcess();
+ virtual void pageClosed();
+
+ virtual void toolTipChanged(const String&, const String&);
+
+ virtual void setCursor(const WebCore::Cursor&);
+ virtual void setCursorHiddenUntilMouseMoves(bool);
+ virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&) = 0;
+
+ virtual void registerEditCommand(PassRefPtr<WebEditCommandProxy>, WebPageProxy::UndoOrRedo);
+ virtual void clearAllEditCommands();
+ virtual bool canUndoRedo(WebPageProxy::UndoOrRedo);
+ virtual void executeUndoRedo(WebPageProxy::UndoOrRedo);
+ virtual WebCore::FloatRect convertToDeviceSpace(const WebCore::FloatRect&);
+ virtual WebCore::FloatRect convertToUserSpace(const WebCore::FloatRect&);
+ virtual WebCore::IntPoint screenToWindow(const WebCore::IntPoint&);
+ virtual WebCore::IntRect windowToScreen(const WebCore::IntRect&);
+
+ void updateTextInputState();
+ virtual void handleDownloadRequest(DownloadProxy*);
+
+ virtual void doneWithKeyEvent(const NativeWebKeyboardEvent&, bool);
+#if ENABLE(TOUCH_EVENTS)
+ virtual void doneWithTouchEvent(const NativeWebTouchEvent&, bool wasEventHandled);
+#endif
+
+ virtual PassRefPtr<WebPopupMenuProxy> createPopupMenuProxy(WebPageProxy*);
+ virtual PassRefPtr<WebContextMenuProxy> createContextMenuProxy(WebPageProxy*);
+
+#if ENABLE(INPUT_TYPE_COLOR)
+ virtual PassRefPtr<WebColorChooserProxy> createColorChooserProxy(WebPageProxy*, const WebCore::Color& initialColor, const WebCore::IntRect&);
+#endif
+
+ virtual void setFindIndicator(PassRefPtr<FindIndicator>, bool, bool);
+#if USE(ACCELERATED_COMPOSITING)
+ virtual void enterAcceleratedCompositingMode(const LayerTreeContext&);
+ virtual void exitAcceleratedCompositingMode();
+ virtual void updateAcceleratedCompositingMode(const LayerTreeContext&);
+#endif
+
+ virtual void didChangeScrollbarsForMainFrame() const;
+
+ virtual void didCommitLoadForMainFrame(bool);
+ virtual void didFinishLoadingDataForCustomRepresentation(const String&, const CoreIPC::DataReference&);
+ virtual double customRepresentationZoomFactor();
+ virtual void setCustomRepresentationZoomFactor(double);
+
+ virtual void flashBackingStoreUpdates(const Vector<WebCore::IntRect>&);
+ virtual void findStringInCustomRepresentation(const String&, FindOptions, unsigned);
+ virtual void countStringMatchesInCustomRepresentation(const String&, FindOptions, unsigned);
+
+#if USE(TILED_BACKING_STORE)
+ virtual void pageDidRequestScroll(const WebCore::IntPoint&) = 0;
+ virtual void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect) = 0;
+ virtual void pageTransitionViewportReady() = 0;
+#endif
+
+protected:
+ EwkViewImpl* m_viewImpl;
+ DefaultUndoController m_undoController;
+};
+
+} // namespace WebKit
+
+#endif // PageClientBase_h
diff --git a/Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.cpp b/Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.cpp
new file mode 100644
index 000000000..7a470ff84
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.cpp
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * 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 "PageClientDefaultImpl.h"
+
+#include "EwkViewImpl.h"
+
+#if USE(TILED_BACKING_STORE)
+#include "PageViewportController.h"
+#include "PageViewportControllerClientEfl.h"
+#endif
+
+using namespace WebCore;
+using namespace EwkViewCallbacks;
+
+namespace WebKit {
+
+PageClientDefaultImpl::PageClientDefaultImpl(EwkViewImpl* viewImpl)
+ : PageClientBase(viewImpl)
+{
+}
+
+void PageClientDefaultImpl::didCommitLoad()
+{
+#if USE(TILED_BACKING_STORE)
+ ASSERT(m_pageViewportController);
+ m_pageViewportController->didCommitLoad();
+#endif
+}
+
+void PageClientDefaultImpl::updateViewportSize(const WebCore::IntSize& size)
+{
+#if USE(TILED_BACKING_STORE)
+ if (!m_pageViewportControllerClient) {
+ m_pageViewportControllerClient = PageViewportControllerClientEfl::create(m_viewImpl);
+ m_pageViewportController = adoptPtr(new PageViewportController(m_viewImpl->page(), m_pageViewportControllerClient.get()));
+ }
+ m_pageViewportControllerClient->updateViewportSize(size);
+#else
+ UNUSED_PARAM(size);
+#endif
+}
+
+void PageClientDefaultImpl::didChangeViewportProperties(const WebCore::ViewportAttributes& attr)
+{
+#if USE(TILED_BACKING_STORE)
+ ASSERT(m_pageViewportController);
+ m_pageViewportController->didChangeViewportAttributes(attr);
+#else
+ UNUSED_PARAM(attr);
+#endif
+}
+
+void PageClientDefaultImpl::didChangeContentsSize(const WebCore::IntSize& size)
+{
+#if USE(TILED_BACKING_STORE)
+ ASSERT(m_pageViewportController);
+ m_pageViewportController->didChangeContentsSize(size);
+#else
+ m_viewImpl->informContentsSizeChange(size);
+#endif
+}
+
+#if USE(TILED_BACKING_STORE)
+void PageClientDefaultImpl::pageDidRequestScroll(const IntPoint& position)
+{
+ ASSERT(m_pageViewportController);
+ m_pageViewportController->pageDidRequestScroll(position);
+}
+
+void PageClientDefaultImpl::didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect)
+{
+ ASSERT(m_pageViewportController);
+ m_pageViewportController->didRenderFrame(contentsSize, coveredRect);
+}
+
+void PageClientDefaultImpl::pageTransitionViewportReady()
+{
+ ASSERT(m_pageViewportController);
+ m_pageViewportController->pageTransitionViewportReady();
+}
+#endif
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.h b/Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.h
new file mode 100644
index 000000000..b69703411
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PageClientDefaultImpl.h
@@ -0,0 +1,66 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * 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 PageClientDefaultImpl_h
+#define PageClientDefaultImpl_h
+
+#include "PageClientBase.h"
+#include "PageViewportController.h"
+#include "PageViewportControllerClientEfl.h"
+
+
+namespace WebKit {
+
+class PageClientDefaultImpl : public PageClientBase {
+public:
+ static PassOwnPtr<PageClientBase> create(EwkViewImpl* viewImpl)
+ {
+ return adoptPtr(new PageClientDefaultImpl(viewImpl));
+ }
+
+ virtual ~PageClientDefaultImpl() { }
+
+ virtual void didCommitLoad();
+ virtual void updateViewportSize(const WebCore::IntSize&);
+
+private:
+ explicit PageClientDefaultImpl(EwkViewImpl*);
+
+ virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&);
+ virtual void didChangeContentsSize(const WebCore::IntSize&);
+#if USE(TILED_BACKING_STORE)
+ virtual void pageDidRequestScroll(const WebCore::IntPoint&);
+ virtual void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
+ virtual void pageTransitionViewportReady();
+
+ OwnPtr<WebKit::PageViewportControllerClientEfl> m_pageViewportControllerClient;
+ OwnPtr<WebKit::PageViewportController> m_pageViewportController;
+#endif
+};
+
+} // namespace WebKit
+
+#endif // PageClientDefaultImpl_h
diff --git a/Source/WebKit2/UIProcess/efl/PageClientLegacyImpl.cpp b/Source/WebKit2/UIProcess/efl/PageClientLegacyImpl.cpp
new file mode 100644
index 000000000..2e0a5b26e
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PageClientLegacyImpl.cpp
@@ -0,0 +1,91 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * 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 "PageClientLegacyImpl.h"
+
+#include "EwkViewImpl.h"
+#include "LayerTreeCoordinatorProxy.h"
+
+using namespace WebCore;
+using namespace EwkViewCallbacks;
+
+namespace WebKit {
+
+PageClientLegacyImpl::PageClientLegacyImpl(EwkViewImpl* viewImpl)
+ : PageClientBase(viewImpl)
+{
+}
+
+void PageClientLegacyImpl::didCommitLoad()
+{
+ m_viewImpl->update();
+}
+
+void PageClientLegacyImpl::updateViewportSize(const WebCore::IntSize& size)
+{
+#if USE(TILED_BACKING_STORE)
+ m_viewImpl->page()->drawingArea()->setVisibleContentsRect(IntRect(m_viewImpl->scrollPosition(), size), m_viewImpl->scaleFactor(), FloatPoint());
+#else
+ UNUSED_PARAM(size);
+#endif
+}
+
+void PageClientLegacyImpl::didChangeViewportProperties(const WebCore::ViewportAttributes&)
+{
+ m_viewImpl->update();
+}
+
+void PageClientLegacyImpl::didChangeContentsSize(const WebCore::IntSize& size)
+{
+#if USE(TILED_BACKING_STORE)
+ // m_viewImpl->informContentSizeChanged will be called as a result of setContentsSize
+ m_viewImpl->page()->drawingArea()->layerTreeCoordinatorProxy()->setContentsSize(FloatSize(size.width(), size.height()));
+ m_viewImpl->update();
+#else
+ m_viewImpl->informContentsSizeChange(size);
+#endif
+}
+
+#if USE(TILED_BACKING_STORE)
+void PageClientLegacyImpl::pageDidRequestScroll(const IntPoint& position)
+{
+ m_viewImpl->setScrollPosition(position);
+ m_viewImpl->update();
+}
+
+void PageClientLegacyImpl::didRenderFrame(const WebCore::IntSize&, const WebCore::IntRect&)
+{
+ m_viewImpl->update();
+}
+
+void PageClientLegacyImpl::pageTransitionViewportReady()
+{
+ m_viewImpl->update();
+}
+#endif
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/PageClientLegacyImpl.h b/Source/WebKit2/UIProcess/efl/PageClientLegacyImpl.h
new file mode 100644
index 000000000..e098aa47c
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PageClientLegacyImpl.h
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2011 Samsung Electronics
+ * 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 PageClientLegacyImpl_h
+#define PageClientLegacyImpl_h
+
+#include "PageClientBase.h"
+
+namespace WebKit {
+
+class PageClientLegacyImpl : public PageClientBase {
+public:
+ static PassOwnPtr<PageClientBase> create(EwkViewImpl* viewImpl)
+ {
+ return adoptPtr(new PageClientLegacyImpl(viewImpl));
+ }
+
+ virtual ~PageClientLegacyImpl() { }
+
+ virtual void didCommitLoad();
+ virtual void updateViewportSize(const WebCore::IntSize&);
+
+private:
+ explicit PageClientLegacyImpl(EwkViewImpl*);
+
+ virtual void didChangeViewportProperties(const WebCore::ViewportAttributes&);
+ virtual void didChangeContentsSize(const WebCore::IntSize&);
+#if USE(TILED_BACKING_STORE)
+ virtual void pageDidRequestScroll(const WebCore::IntPoint&);
+ virtual void didRenderFrame(const WebCore::IntSize& contentsSize, const WebCore::IntRect& coveredRect);
+ virtual void pageTransitionViewportReady();
+#endif
+};
+
+} // namespace WebKit
+
+#endif // PageClientLegacyImpl_h
diff --git a/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.cpp b/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.cpp
index 2425b157d..f1b49b780 100644
--- a/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.cpp
@@ -26,14 +26,19 @@
#include "config.h"
#include "PageLoadClientEfl.h"
+#include "EwkViewImpl.h"
+#include "WKAPICast.h"
#include "WKFrame.h"
#include "WKPage.h"
+#include "ewk_auth_request_private.h"
#include "ewk_back_forward_list_private.h"
#include "ewk_error_private.h"
#include "ewk_intent_private.h"
#include "ewk_intent_service_private.h"
#include "ewk_view.h"
+using namespace EwkViewCallbacks;
+
namespace WebKit {
static inline PageLoadClientEfl* toPageLoadClientEfl(const void* clientInfo)
@@ -46,32 +51,33 @@ void PageLoadClientEfl::didReceiveTitleForFrame(WKPageRef, WKStringRef title, WK
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
- ewk_view_title_changed(ewkView, toImpl(title)->string().utf8().data());
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
+ viewImpl->smartCallback<TitleChange>().call(toImpl(title)->string());
}
#if ENABLE(WEB_INTENTS)
void PageLoadClientEfl::didReceiveIntentForFrame(WKPageRef, WKFrameRef, WKIntentDataRef intent, WKTypeRef, const void* clientInfo)
{
- Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
RefPtr<Ewk_Intent> ewkIntent = Ewk_Intent::create(intent);
- ewk_view_intent_request_new(ewkView, ewkIntent.get());
+ viewImpl->smartCallback<IntentRequest>().call(ewkIntent.get());
}
#endif
#if ENABLE(WEB_INTENTS_TAG)
void PageLoadClientEfl::registerIntentServiceForFrame(WKPageRef, WKFrameRef, WKIntentServiceInfoRef serviceInfo, WKTypeRef, const void* clientInfo)
{
- Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
RefPtr<Ewk_Intent_Service> ewkIntentService = Ewk_Intent_Service::create(serviceInfo);
- ewk_view_intent_service_register(ewkView, ewkIntentService.get());
+ viewImpl->smartCallback<IntentServiceRegistration>().call(ewkIntentService.get());
}
#endif
void PageLoadClientEfl::didChangeProgress(WKPageRef page, const void* clientInfo)
{
- Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
- ewk_view_load_progress_changed(ewkView, WKPageGetEstimatedProgress(page));
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
+ double progress = WKPageGetEstimatedProgress(page);
+ viewImpl->smartCallback<LoadProgress>().call(&progress);
}
void PageLoadClientEfl::didFinishLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void* clientInfo)
@@ -79,8 +85,8 @@ void PageLoadClientEfl::didFinishLoadForFrame(WKPageRef, WKFrameRef frame, WKTyp
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
- ewk_view_load_finished(ewkView);
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
+ viewImpl->smartCallback<LoadFinished>().call();
}
void PageLoadClientEfl::didFailLoadWithErrorForFrame(WKPageRef, WKFrameRef frame, WKErrorRef error, WKTypeRef, const void* clientInfo)
@@ -88,10 +94,10 @@ void PageLoadClientEfl::didFailLoadWithErrorForFrame(WKPageRef, WKFrameRef frame
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
OwnPtr<Ewk_Error> ewkError = Ewk_Error::create(error);
- ewk_view_load_error(ewkView, ewkError.get());
- ewk_view_load_finished(ewkView);
+ viewImpl->smartCallback<LoadError>().call(ewkError.get());
+ viewImpl->smartCallback<LoadFinished>().call();
}
void PageLoadClientEfl::didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void* clientInfo)
@@ -99,8 +105,9 @@ void PageLoadClientEfl::didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef fr
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
- ewk_view_load_provisional_started(ewkView);
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
+ viewImpl->informURLChange();
+ viewImpl->smartCallback<ProvisionalLoadStarted>().call();
}
void PageLoadClientEfl::didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef /*userData*/, const void* clientInfo)
@@ -108,8 +115,9 @@ void PageLoadClientEfl::didReceiveServerRedirectForProvisionalLoadForFrame(WKPag
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
- ewk_view_load_provisional_redirect(ewkView);
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
+ viewImpl->informURLChange();
+ viewImpl->smartCallback<ProvisionalLoadRedirect>().call();
}
void PageLoadClientEfl::didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFrameRef frame, WKErrorRef error, WKTypeRef, const void* clientInfo)
@@ -117,21 +125,32 @@ void PageLoadClientEfl::didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFra
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
OwnPtr<Ewk_Error> ewkError = Ewk_Error::create(error);
- ewk_view_load_provisional_failed(ewkView, ewkError.get());
+ viewImpl->smartCallback<ProvisionalLoadFailed>().call(ewkError.get());
}
+#if USE(TILED_BACKING_STORE)
+void PageLoadClientEfl::didCommitLoadForFrame(WKPageRef, WKFrameRef frame, WKTypeRef, const void* clientInfo)
+{
+ if (!WKFrameIsMainFrame(frame))
+ return;
+
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
+ viewImpl->informLoadCommitted();
+}
+#endif
+
void PageLoadClientEfl::didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo)
{
- Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
- ASSERT(ewkView);
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
+ ASSERT(viewImpl);
- Ewk_Back_Forward_List* list = ewk_view_back_forward_list_get(ewkView);
+ Ewk_Back_Forward_List* list = ewk_view_back_forward_list_get(viewImpl->view());
ASSERT(list);
list->update(addedItem, removedItems);
- ewk_view_back_forward_list_changed(ewkView);
+ viewImpl->smartCallback<BackForwardListChange>().call();
}
void PageLoadClientEfl::didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef frame, WKSameDocumentNavigationType, WKTypeRef, const void* clientInfo)
@@ -139,14 +158,22 @@ void PageLoadClientEfl::didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef
if (!WKFrameIsMainFrame(frame))
return;
- Evas_Object* ewkView = toPageLoadClientEfl(clientInfo)->view();
- ewk_view_url_update(ewkView);
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
+ viewImpl->informURLChange();
+}
+
+void PageLoadClientEfl::didReceiveAuthenticationChallengeInFrame(WKPageRef, WKFrameRef, WKAuthenticationChallengeRef authenticationChallenge, const void* clientInfo)
+{
+ EwkViewImpl* viewImpl = toPageLoadClientEfl(clientInfo)->viewImpl();
+
+ RefPtr<Ewk_Auth_Request> authenticationRequest = EwkAuthRequest::create(toImpl(authenticationChallenge));
+ viewImpl->smartCallback<AuthenticationRequest>().call(authenticationRequest.get());
}
-PageLoadClientEfl::PageLoadClientEfl(Evas_Object* view)
- : m_view(view)
+PageLoadClientEfl::PageLoadClientEfl(EwkViewImpl* viewImpl)
+ : m_viewImpl(viewImpl)
{
- WKPageRef pageRef = ewk_view_wkpage_get(m_view);
+ WKPageRef pageRef = m_viewImpl->wkPage();
ASSERT(pageRef);
WKPageLoaderClient loadClient;
@@ -168,8 +195,12 @@ PageLoadClientEfl::PageLoadClientEfl(Evas_Object* view)
loadClient.didStartProvisionalLoadForFrame = didStartProvisionalLoadForFrame;
loadClient.didReceiveServerRedirectForProvisionalLoadForFrame = didReceiveServerRedirectForProvisionalLoadForFrame;
loadClient.didFailProvisionalLoadWithErrorForFrame = didFailProvisionalLoadWithErrorForFrame;
+#if USE(TILED_BACKING_STORE)
+ loadClient.didCommitLoadForFrame = didCommitLoadForFrame;
+#endif
loadClient.didChangeBackForwardList = didChangeBackForwardList;
loadClient.didSameDocumentNavigationForFrame = didSameDocumentNavigationForFrame;
+ loadClient.didReceiveAuthenticationChallengeInFrame = didReceiveAuthenticationChallengeInFrame;
WKPageSetPageLoaderClient(pageRef, &loadClient);
}
diff --git a/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.h b/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.h
index 68cc17d6a..cd713a3cd 100644
--- a/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.h
+++ b/Source/WebKit2/UIProcess/efl/PageLoadClientEfl.h
@@ -26,22 +26,25 @@
#ifndef PageLoadClientEfl_h
#define PageLoadClientEfl_h
-#include "ewk_view_private.h"
+#include "WKPageLoadTypes.h"
+#include <WebKit2/WKBase.h>
#include <wtf/PassOwnPtr.h>
+class EwkViewImpl;
+
namespace WebKit {
class PageLoadClientEfl {
public:
- static PassOwnPtr<PageLoadClientEfl> create(Evas_Object* view)
+ static PassOwnPtr<PageLoadClientEfl> create(EwkViewImpl* viewImpl)
{
- return adoptPtr(new PageLoadClientEfl(view));
+ return adoptPtr(new PageLoadClientEfl(viewImpl));
}
private:
- explicit PageLoadClientEfl(Evas_Object* view);
+ explicit PageLoadClientEfl(EwkViewImpl*);
- inline Evas_Object* view() const { return m_view; }
+ inline EwkViewImpl* viewImpl() const { return m_viewImpl; }
static void didReceiveTitleForFrame(WKPageRef, WKStringRef title, WKFrameRef, WKTypeRef, const void* clientInfo);
#if ENABLE(WEB_INTENTS)
@@ -56,10 +59,14 @@ private:
static void didStartProvisionalLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
static void didReceiveServerRedirectForProvisionalLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
static void didFailProvisionalLoadWithErrorForFrame(WKPageRef, WKFrameRef, WKErrorRef, WKTypeRef userData, const void* clientInfo);
+#if USE(TILED_BACKING_STORE)
+ static void didCommitLoadForFrame(WKPageRef, WKFrameRef, WKTypeRef userData, const void* clientInfo);
+#endif
static void didChangeBackForwardList(WKPageRef, WKBackForwardListItemRef addedItem, WKArrayRef removedItems, const void* clientInfo);
static void didSameDocumentNavigationForFrame(WKPageRef, WKFrameRef, WKSameDocumentNavigationType, WKTypeRef, const void* clientInfo);
+ static void didReceiveAuthenticationChallengeInFrame(WKPageRef, WKFrameRef, WKAuthenticationChallengeRef, const void* clientInfo);
- Evas_Object* m_view;
+ EwkViewImpl* m_viewImpl;
};
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/PagePolicyClientEfl.cpp b/Source/WebKit2/UIProcess/efl/PagePolicyClientEfl.cpp
new file mode 100644
index 000000000..254f29a6e
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PagePolicyClientEfl.cpp
@@ -0,0 +1,122 @@
+/*
+ * 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 "PagePolicyClientEfl.h"
+
+#include "EwkViewImpl.h"
+#include "WKFrame.h"
+#include "WKFramePolicyListener.h"
+#include "WebFrameProxy.h"
+#include "ewk_navigation_policy_decision.h"
+#include "ewk_navigation_policy_decision_private.h"
+#include <WebCore/HTTPStatusCodes.h>
+#include <wtf/text/CString.h>
+
+using namespace EwkViewCallbacks;
+
+namespace WebKit {
+
+static inline PagePolicyClientEfl* toPagePolicyClientEfl(const void* clientInfo)
+{
+ return static_cast<PagePolicyClientEfl*>(const_cast<void*>(clientInfo));
+}
+
+void PagePolicyClientEfl::decidePolicyForNavigationAction(WKPageRef, WKFrameRef, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKFramePolicyListenerRef listener, WKTypeRef /*userData*/, const void* clientInfo)
+{
+ PagePolicyClientEfl* policyClient = toPagePolicyClientEfl(clientInfo);
+
+ RefPtr<Ewk_Navigation_Policy_Decision> decision = Ewk_Navigation_Policy_Decision::create(navigationType, mouseButton, modifiers, request, 0, listener);
+ policyClient->m_viewImpl->smartCallback<NavigationPolicyDecision>().call(decision.get());
+}
+
+void PagePolicyClientEfl::decidePolicyForNewWindowAction(WKPageRef, WKFrameRef, WKFrameNavigationType navigationType, WKEventModifiers modifiers, WKEventMouseButton mouseButton, WKURLRequestRef request, WKStringRef frameName, WKFramePolicyListenerRef listener, WKTypeRef /*userData*/, const void* clientInfo)
+{
+ PagePolicyClientEfl* policyClient = toPagePolicyClientEfl(clientInfo);
+
+ RefPtr<Ewk_Navigation_Policy_Decision> decision = Ewk_Navigation_Policy_Decision::create(navigationType, mouseButton, modifiers, request, toImpl(frameName)->string().utf8().data(), listener);
+ policyClient->m_viewImpl->smartCallback<NewWindowPolicyDecision>().call(decision.get());
+}
+
+void PagePolicyClientEfl::decidePolicyForResponseCallback(WKPageRef, WKFrameRef frame, WKURLResponseRef response, WKURLRequestRef, WKFramePolicyListenerRef listener, WKTypeRef /*userData*/, const void* /*clientInfo*/)
+{
+ using namespace WebCore;
+
+ const ResourceResponse resourceResponse = toImpl(response)->resourceResponse();
+
+ // Ignore responses with an HTTP status code of 204 (No Content)
+ if (resourceResponse.httpStatusCode() == HTTPNoContent) {
+ WKFramePolicyListenerIgnore(listener);
+ return;
+ }
+
+ // If the URL Response has "Content-Disposition: attachment;" header, then
+ // we should download it.
+ if (resourceResponse.isAttachment()) {
+ WKFramePolicyListenerDownload(listener);
+ return;
+ }
+
+ String mimeType = toImpl(response)->resourceResponse().mimeType().lower();
+ bool canShowMIMEType = toImpl(frame)->canShowMIMEType(mimeType);
+ if (WKFrameIsMainFrame(frame)) {
+ if (canShowMIMEType) {
+ WKFramePolicyListenerUse(listener);
+ return;
+ }
+
+ // If we can't use (show) it then we should download it.
+ WKFramePolicyListenerDownload(listener);
+ return;
+ }
+
+ // We should ignore downloadable top-level content for subframes, with an exception for text/xml and application/xml so we can still support Acid3 test.
+ // It makes the browser intentionally behave differently when it comes to text(application)/xml content in subframes vs. mainframe.
+ if (!canShowMIMEType && !(mimeType == "text/xml" || mimeType == "application/xml")) {
+ WKFramePolicyListenerIgnore(listener);
+ return;
+ }
+
+ WKFramePolicyListenerUse(listener);
+}
+
+PagePolicyClientEfl::PagePolicyClientEfl(EwkViewImpl* viewImpl)
+ : m_viewImpl(viewImpl)
+{
+ WKPageRef pageRef = m_viewImpl->wkPage();
+ ASSERT(pageRef);
+
+ WKPagePolicyClient policyClient;
+ memset(&policyClient, 0, sizeof(WKPagePolicyClient));
+ policyClient.version = kWKPagePolicyClientCurrentVersion;
+ policyClient.clientInfo = this;
+ policyClient.decidePolicyForNavigationAction = decidePolicyForNavigationAction;
+ policyClient.decidePolicyForNewWindowAction = decidePolicyForNewWindowAction;
+ policyClient.decidePolicyForResponse = decidePolicyForResponseCallback;
+
+ WKPageSetPagePolicyClient(pageRef, &policyClient);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/PagePolicyClientEfl.h b/Source/WebKit2/UIProcess/efl/PagePolicyClientEfl.h
new file mode 100644
index 000000000..68d9a9ee9
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PagePolicyClientEfl.h
@@ -0,0 +1,57 @@
+/*
+ * 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 PagePolicyClientEfl_h
+#define PagePolicyClientEfl_h
+
+#include "WKEvent.h"
+#include "WKPageLoadTypes.h"
+#include <WebKit2/WKBase.h>
+#include <wtf/PassOwnPtr.h>
+
+class EwkViewImpl;
+
+namespace WebKit {
+
+class PagePolicyClientEfl {
+public:
+ static PassOwnPtr<PagePolicyClientEfl> create(EwkViewImpl* viewImpl)
+ {
+ return adoptPtr(new PagePolicyClientEfl(viewImpl));
+ }
+
+private:
+ explicit PagePolicyClientEfl(EwkViewImpl*);
+
+ static void decidePolicyForNavigationAction(WKPageRef, WKFrameRef, WKFrameNavigationType, WKEventModifiers, WKEventMouseButton, WKURLRequestRef, WKFramePolicyListenerRef, WKTypeRef, const void*);
+ static void decidePolicyForNewWindowAction(WKPageRef, WKFrameRef, WKFrameNavigationType, WKEventModifiers, WKEventMouseButton, WKURLRequestRef, WKStringRef, WKFramePolicyListenerRef, WKTypeRef, const void*);
+ static void decidePolicyForResponseCallback(WKPageRef, WKFrameRef, WKURLResponseRef, WKURLRequestRef, WKFramePolicyListenerRef, WKTypeRef, const void*);
+
+ EwkViewImpl* m_viewImpl;
+};
+
+} // namespace WebKit
+
+#endif // PagePolicyClientEfl_h
diff --git a/Source/WebKit2/UIProcess/efl/PageUIClientEfl.cpp b/Source/WebKit2/UIProcess/efl/PageUIClientEfl.cpp
new file mode 100644
index 000000000..4110b6b96
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PageUIClientEfl.cpp
@@ -0,0 +1,168 @@
+/*
+ * 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 "PageUIClientEfl.h"
+
+#include "EwkViewImpl.h"
+#include "WKAPICast.h"
+#include "WKEvent.h"
+#include "WKString.h"
+#include "ewk_file_chooser_request_private.h"
+#include <Ecore_Evas.h>
+#include <WebCore/Color.h>
+
+using namespace EwkViewCallbacks;
+
+namespace WebKit {
+
+static inline PageUIClientEfl* toPageUIClientEfl(const void* clientInfo)
+{
+ return static_cast<PageUIClientEfl*>(const_cast<void*>(clientInfo));
+}
+
+void PageUIClientEfl::closePage(WKPageRef, const void* clientInfo)
+{
+ toPageUIClientEfl(clientInfo)->m_viewImpl->closePage();
+}
+
+WKPageRef PageUIClientEfl::createNewPage(WKPageRef, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void* clientInfo)
+{
+ return toPageUIClientEfl(clientInfo)->m_viewImpl->createNewPage();
+}
+
+void PageUIClientEfl::runJavaScriptAlert(WKPageRef, WKStringRef alertText, WKFrameRef, const void* clientInfo)
+{
+ toPageUIClientEfl(clientInfo)->m_viewImpl->requestJSAlertPopup(WKEinaSharedString(alertText));
+}
+
+bool PageUIClientEfl::runJavaScriptConfirm(WKPageRef, WKStringRef message, WKFrameRef, const void* clientInfo)
+{
+ return toPageUIClientEfl(clientInfo)->m_viewImpl->requestJSConfirmPopup(WKEinaSharedString(message));
+}
+
+WKStringRef PageUIClientEfl::runJavaScriptPrompt(WKPageRef, WKStringRef message, WKStringRef defaultValue, WKFrameRef, const void* clientInfo)
+{
+ WKEinaSharedString value = toPageUIClientEfl(clientInfo)->m_viewImpl->requestJSPromptPopup(WKEinaSharedString(message), WKEinaSharedString(defaultValue));
+ return value ? WKStringCreateWithUTF8CString(value) : 0;
+}
+
+#if ENABLE(INPUT_TYPE_COLOR)
+void PageUIClientEfl::showColorPicker(WKPageRef, WKStringRef initialColor, WKColorPickerResultListenerRef listener, const void* clientInfo)
+{
+ PageUIClientEfl* pageUIClient = toPageUIClientEfl(clientInfo);
+ WebCore::Color color = WebCore::Color(WebKit::toWTFString(initialColor));
+ pageUIClient->m_viewImpl->requestColorPicker(listener, color);
+}
+
+void PageUIClientEfl::hideColorPicker(WKPageRef, const void* clientInfo)
+{
+ PageUIClientEfl* pageUIClient = toPageUIClientEfl(clientInfo);
+ pageUIClient->m_viewImpl->dismissColorPicker();
+}
+#endif
+
+#if ENABLE(SQL_DATABASE)
+unsigned long long PageUIClientEfl::exceededDatabaseQuota(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKStringRef databaseName, WKStringRef displayName, unsigned long long currentQuota, unsigned long long currentOriginUsage, unsigned long long currentDatabaseUsage, unsigned long long expectedUsage, const void* clientInfo)
+{
+ EwkViewImpl* viewImpl = toPageUIClientEfl(clientInfo)->m_viewImpl;
+ return viewImpl->informDatabaseQuotaReached(toImpl(databaseName)->string(), toImpl(displayName)->string(), currentQuota, currentOriginUsage, currentDatabaseUsage, expectedUsage);
+}
+#endif
+
+void PageUIClientEfl::focus(WKPageRef, const void* clientInfo)
+{
+ evas_object_focus_set(toPageUIClientEfl(clientInfo)->m_viewImpl->view(), true);
+}
+
+void PageUIClientEfl::unfocus(WKPageRef, const void* clientInfo)
+{
+ evas_object_focus_set(toPageUIClientEfl(clientInfo)->m_viewImpl->view(), false);
+}
+
+void PageUIClientEfl::takeFocus(WKPageRef, WKFocusDirection, const void* clientInfo)
+{
+ // FIXME: this is only a partial implementation.
+ evas_object_focus_set(toPageUIClientEfl(clientInfo)->m_viewImpl->view(), false);
+}
+
+WKRect PageUIClientEfl::getWindowFrame(WKPageRef, const void* clientInfo)
+{
+ int x, y, width, height;
+
+ Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(toPageUIClientEfl(clientInfo)->m_viewImpl->view()));
+ ecore_evas_request_geometry_get(ee, &x, &y, &width, &height);
+
+ return WKRectMake(x, y, width, height);
+}
+
+void PageUIClientEfl::setWindowFrame(WKPageRef, WKRect frame, const void* clientInfo)
+{
+ Ecore_Evas* ee = ecore_evas_ecore_evas_get(evas_object_evas_get(toPageUIClientEfl(clientInfo)->m_viewImpl->view()));
+ ecore_evas_move_resize(ee, frame.origin.x, frame.origin.y, frame.size.width, frame.size.height);
+}
+
+void PageUIClientEfl::runOpenPanel(WKPageRef, WKFrameRef, WKOpenPanelParametersRef parameters, WKOpenPanelResultListenerRef listener, const void* clientInfo)
+{
+ EwkViewImpl* viewImpl = toPageUIClientEfl(clientInfo)->m_viewImpl;
+ RefPtr<Ewk_File_Chooser_Request> fileChooserRequest = Ewk_File_Chooser_Request::create(toImpl(parameters), toImpl(listener));
+ viewImpl->smartCallback<FileChooserRequest>().call(fileChooserRequest.get());
+}
+
+PageUIClientEfl::PageUIClientEfl(EwkViewImpl* viewImpl)
+ : m_viewImpl(viewImpl)
+{
+ WKPageRef pageRef = m_viewImpl->wkPage();
+ ASSERT(pageRef);
+
+ WKPageUIClient uiClient;
+ memset(&uiClient, 0, sizeof(WKPageUIClient));
+ uiClient.version = kWKPageUIClientCurrentVersion;
+ uiClient.clientInfo = this;
+ uiClient.close = closePage;
+ uiClient.createNewPage = createNewPage;
+ uiClient.runJavaScriptAlert = runJavaScriptAlert;
+ uiClient.runJavaScriptConfirm = runJavaScriptConfirm;
+ uiClient.runJavaScriptPrompt = runJavaScriptPrompt;
+ uiClient.takeFocus = takeFocus;
+ uiClient.focus = focus;
+ uiClient.unfocus = unfocus;
+ uiClient.getWindowFrame = getWindowFrame;
+ uiClient.setWindowFrame = setWindowFrame;
+ uiClient.runOpenPanel = runOpenPanel;
+#if ENABLE(SQL_DATABASE)
+ uiClient.exceededDatabaseQuota = exceededDatabaseQuota;
+#endif
+
+#if ENABLE(INPUT_TYPE_COLOR)
+ uiClient.showColorPicker = showColorPicker;
+ uiClient.hideColorPicker = hideColorPicker;
+#endif
+
+ WKPageSetPageUIClient(pageRef, &uiClient);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/PageUIClientEfl.h b/Source/WebKit2/UIProcess/efl/PageUIClientEfl.h
new file mode 100644
index 000000000..2f54192a2
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PageUIClientEfl.h
@@ -0,0 +1,72 @@
+/*
+ * 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 PageUIClientEfl_h
+#define PageUIClientEfl_h
+
+#include "WKPage.h"
+#include <WebKit2/WKBase.h>
+#include <wtf/PassOwnPtr.h>
+
+class EwkViewImpl;
+
+namespace WebKit {
+
+class PageUIClientEfl {
+public:
+ static PassOwnPtr<PageUIClientEfl> create(EwkViewImpl* viewImpl)
+ {
+ return adoptPtr(new PageUIClientEfl(viewImpl));
+ }
+
+private:
+ explicit PageUIClientEfl(EwkViewImpl*);
+
+ static void closePage(WKPageRef, const void*);
+ static WKPageRef createNewPage(WKPageRef, WKURLRequestRef, WKDictionaryRef, WKEventModifiers, WKEventMouseButton, const void*);
+ static void runJavaScriptAlert(WKPageRef, WKStringRef, WKFrameRef, const void*);
+ static bool runJavaScriptConfirm(WKPageRef, WKStringRef, WKFrameRef, const void*);
+ static WKStringRef runJavaScriptPrompt(WKPageRef, WKStringRef, WKStringRef, WKFrameRef, const void*);
+#if ENABLE(INPUT_TYPE_COLOR)
+ static void showColorPicker(WKPageRef, WKStringRef initialColor, WKColorPickerResultListenerRef, const void*);
+ static void hideColorPicker(WKPageRef, const void*);
+#endif
+#if ENABLE(SQL_DATABASE)
+ static unsigned long long exceededDatabaseQuota(WKPageRef, WKFrameRef, WKSecurityOriginRef, WKStringRef, WKStringRef, unsigned long long currentQuota, unsigned long long, unsigned long long, unsigned long long, const void*);
+#endif
+ static void focus(WKPageRef, const void*);
+ static void unfocus(WKPageRef, const void*);
+ static void takeFocus(WKPageRef, WKFocusDirection, const void*);
+ static WKRect getWindowFrame(WKPageRef, const void*);
+ static void setWindowFrame(WKPageRef, WKRect, const void*);
+ static void runOpenPanel(WKPageRef, WKFrameRef, WKOpenPanelParametersRef, WKOpenPanelResultListenerRef, const void*);
+
+ EwkViewImpl* m_viewImpl;
+};
+
+} // namespace WebKit
+
+#endif // PageUIClientEfl_h
diff --git a/Source/WebKit2/UIProcess/efl/PageViewportControllerClientEfl.cpp b/Source/WebKit2/UIProcess/efl/PageViewportControllerClientEfl.cpp
new file mode 100644
index 000000000..65006c288
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PageViewportControllerClientEfl.cpp
@@ -0,0 +1,125 @@
+/*
+ * 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 "PageViewportControllerClientEfl.h"
+
+#if USE(TILED_BACKING_STORE)
+
+#include "EwkViewImpl.h"
+#include "LayerTreeCoordinatorProxy.h"
+#include "LayerTreeRenderer.h"
+#include "PageViewportController.h"
+#include "TransformationMatrix.h"
+#include "ewk_view_private.h"
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PageViewportControllerClientEfl::PageViewportControllerClientEfl(EwkViewImpl* viewImpl)
+ : m_viewImpl(viewImpl)
+ , m_scaleFactor(1)
+ , m_controller(0)
+{
+ ASSERT(m_viewImpl);
+}
+
+PageViewportControllerClientEfl::~PageViewportControllerClientEfl()
+{
+}
+
+DrawingAreaProxy* PageViewportControllerClientEfl::drawingArea() const
+{
+ return m_viewImpl->page()->drawingArea();
+}
+
+void PageViewportControllerClientEfl::setRendererActive(bool active)
+{
+ drawingArea()->layerTreeCoordinatorProxy()->layerTreeRenderer()->setActive(active);
+}
+
+void PageViewportControllerClientEfl::updateViewportSize(const IntSize& viewportSize)
+{
+ m_viewportSize = viewportSize;
+
+ ASSERT(m_controller);
+ m_controller->didChangeViewportSize(viewportSize);
+}
+
+void PageViewportControllerClientEfl::setVisibleContentsRect(const IntPoint& newScrollPosition, float newScale, const FloatPoint& trajectory)
+{
+ m_scaleFactor = newScale;
+ m_scrollPosition = newScrollPosition;
+
+ ASSERT(m_controller);
+ m_controller->didChangeContentsVisibility(m_scrollPosition, m_scaleFactor, trajectory);
+}
+
+void PageViewportControllerClientEfl::didChangeContentsSize(const WebCore::IntSize&)
+{
+ m_viewImpl->update();
+}
+
+void PageViewportControllerClientEfl::setViewportPosition(const WebCore::FloatPoint& contentsPoint)
+{
+ IntPoint position(contentsPoint.x(), contentsPoint.y());
+ setVisibleContentsRect(position, m_scaleFactor, FloatPoint());
+ m_viewImpl->setScrollPosition(position);
+}
+
+void PageViewportControllerClientEfl::setContentsScale(float newScale, bool treatAsInitialValue)
+{
+ if (treatAsInitialValue) {
+ m_scrollPosition = IntPoint();
+ m_viewImpl->setScrollPosition(IntPoint());
+ }
+ m_scaleFactor = newScale;
+ m_viewImpl->setScaleFactor(newScale);
+}
+
+void PageViewportControllerClientEfl::didResumeContent()
+{
+ ASSERT(m_controller);
+ m_controller->didChangeContentsVisibility(m_scrollPosition, m_scaleFactor);
+}
+
+void PageViewportControllerClientEfl::didChangeVisibleContents()
+{
+ m_viewImpl->update();
+}
+
+void PageViewportControllerClientEfl::didChangeViewportAttributes()
+{
+}
+
+void PageViewportControllerClientEfl::setController(PageViewportController* controller)
+{
+ m_controller = controller;
+}
+
+} // namespace WebKit
+#endif // USE(TILED_BACKING_STORE)
+
diff --git a/Source/WebKit2/UIProcess/efl/PageViewportControllerClientEfl.h b/Source/WebKit2/UIProcess/efl/PageViewportControllerClientEfl.h
new file mode 100644
index 000000000..ee9d37690
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/PageViewportControllerClientEfl.h
@@ -0,0 +1,80 @@
+/*
+ * 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 PageViewportControllerClientEfl_h
+#define PageViewportControllerClientEfl_h
+
+#if USE(TILED_BACKING_STORE)
+
+#include "PageClientBase.h"
+#include "PageViewportControllerClient.h"
+#include <wtf/PassOwnPtr.h>
+
+class EwkViewImpl;
+
+namespace WebKit {
+
+class PageViewportControllerClientEfl : public PageViewportControllerClient {
+public:
+ static PassOwnPtr<PageViewportControllerClientEfl> create(EwkViewImpl* viewImpl)
+ {
+ return adoptPtr(new PageViewportControllerClientEfl(viewImpl));
+ }
+ ~PageViewportControllerClientEfl();
+
+ DrawingAreaProxy* drawingArea() const;
+ WebCore::IntSize viewSize() { return m_viewportSize; }
+ float scaleFactor() const { return m_scaleFactor; }
+ WebCore::IntPoint scrollPosition() { return m_scrollPosition; }
+
+ void updateViewportSize(const WebCore::IntSize& viewportSize);
+ void setVisibleContentsRect(const WebCore::IntPoint&, float, const WebCore::FloatPoint&);
+ void setRendererActive(bool);
+
+ virtual void setViewportPosition(const WebCore::FloatPoint& contentsPoint);
+ virtual void setContentsScale(float, bool treatAsInitialValue);
+
+ virtual void didResumeContent();
+ virtual void didChangeContentsSize(const WebCore::IntSize&);
+ virtual void didChangeVisibleContents();
+ virtual void didChangeViewportAttributes();
+
+ virtual void setController(PageViewportController*);
+
+private:
+ explicit PageViewportControllerClientEfl(EwkViewImpl*);
+
+ EwkViewImpl* m_viewImpl;
+ WebCore::IntSize m_viewportSize;
+ WebCore::IntPoint m_scrollPosition;
+ float m_scaleFactor;
+ PageViewportController* m_controller;
+};
+
+} // namespace WebKit
+
+#endif
+
+#endif // PageViewportControllerClientEfl_h
diff --git a/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp b/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp
new file mode 100644
index 000000000..3fb32c647
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.cpp
@@ -0,0 +1,96 @@
+/*
+ * 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 "RequestManagerClientEfl.h"
+
+#include "WKContextSoup.h"
+#include "WKSoupRequestManager.h"
+#include "WebSoupRequestManagerProxy.h"
+#include "ewk_context_private.h"
+#include "ewk_url_scheme_request_private.h"
+
+namespace WebKit {
+
+struct Ewk_Url_Scheme_Handler {
+ Ewk_Url_Scheme_Request_Cb callback;
+ void* userData;
+
+ Ewk_Url_Scheme_Handler()
+ : callback(0)
+ , userData(0)
+ { }
+
+ Ewk_Url_Scheme_Handler(Ewk_Url_Scheme_Request_Cb callback, void* userData)
+ : callback(callback)
+ , userData(userData)
+ { }
+};
+
+static inline RequestManagerClientEfl* toRequestManagerClientEfl(const void* clientInfo)
+{
+ return static_cast<RequestManagerClientEfl*>(const_cast<void*>(clientInfo));
+}
+
+void RequestManagerClientEfl::didReceiveURIRequest(WKSoupRequestManagerRef soupRequestManagerRef, WKURLRef urlRef, WKPageRef, uint64_t requestID, const void* clientInfo)
+{
+ RequestManagerClientEfl* requestManager = toRequestManagerClientEfl(clientInfo);
+
+ RefPtr<EwkUrlSchemeRequest> schemeRequest = EwkUrlSchemeRequest::create(soupRequestManagerRef, urlRef, requestID);
+ Ewk_Url_Scheme_Handler handler = requestManager->m_urlSchemeHandlers.get(schemeRequest->scheme());
+ if (!handler.callback)
+ return;
+
+ handler.callback(schemeRequest.get(), handler.userData);
+}
+
+RequestManagerClientEfl::RequestManagerClientEfl(EwkContext* context)
+ : m_soupRequestManager(WKContextGetSoupRequestManager(context->wkContext()))
+{
+ ASSERT(context);
+
+ WKSoupRequestManagerClient wkRequestManagerClient;
+ memset(&wkRequestManagerClient, 0, sizeof(WKSoupRequestManagerClient));
+
+ wkRequestManagerClient.version = kWKSoupRequestManagerClientCurrentVersion;
+ wkRequestManagerClient.clientInfo = this;
+ wkRequestManagerClient.didReceiveURIRequest = didReceiveURIRequest;
+
+ WKSoupRequestManagerSetClient(m_soupRequestManager.get(), &wkRequestManagerClient);
+}
+
+RequestManagerClientEfl::~RequestManagerClientEfl()
+{
+}
+
+void RequestManagerClientEfl::registerURLSchemeHandler(const String& scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData)
+{
+ ASSERT(callback);
+
+ m_urlSchemeHandlers.set(scheme, Ewk_Url_Scheme_Handler(callback, userData));
+ toImpl(m_soupRequestManager.get())->registerURIScheme(scheme);
+}
+
+} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h b/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h
new file mode 100644
index 000000000..71aaedf7c
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/RequestManagerClientEfl.h
@@ -0,0 +1,59 @@
+/*
+ * 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 RequestManagerClientEfl_h
+#define RequestManagerClientEfl_h
+
+#include "WKRetainPtr.h"
+#include "ewk_context_private.h"
+#include <WebKit2/WKBase.h>
+#include <wtf/HashMap.h>
+#include <wtf/PassOwnPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebKit {
+
+class RequestManagerClientEfl {
+public:
+ ~RequestManagerClientEfl();
+ static PassOwnPtr<RequestManagerClientEfl> create(EwkContext* context)
+ {
+ return adoptPtr(new RequestManagerClientEfl(context));
+ }
+
+ void registerURLSchemeHandler(const String& scheme, Ewk_Url_Scheme_Request_Cb callback, void* userData);
+
+private:
+ explicit RequestManagerClientEfl(EwkContext*);
+
+ static void didReceiveURIRequest(WKSoupRequestManagerRef, WKURLRef, WKPageRef, uint64_t requestID, const void* clientInfo);
+
+ WKRetainPtr<WKSoupRequestManagerRef> m_soupRequestManager;
+ HashMap<String, class Ewk_Url_Scheme_Handler> m_urlSchemeHandlers;
+};
+
+} // namespace WebKit
+
+#endif // RequestManagerClientEfl_h
diff --git a/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp b/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp
index 6539cce36..a5b689813 100644
--- a/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.cpp
@@ -26,6 +26,7 @@
#include "config.h"
#include "ResourceLoadClientEfl.h"
+#include "EwkViewImpl.h"
#include "WKAPICast.h"
#include "WKFrame.h"
#include "WKPage.h"
@@ -33,8 +34,10 @@
#include "ewk_error_private.h"
#include "ewk_url_request_private.h"
#include "ewk_url_response_private.h"
+#include "ewk_view.h"
using namespace WebCore;
+using namespace EwkViewCallbacks;
namespace WebKit {
@@ -54,8 +57,9 @@ void ResourceLoadClientEfl::didInitiateLoadForResource(WKPageRef, WKFrameRef wkF
// Keep the resource internally to reuse it later.
resourceLoadClient->m_loadingResourcesMap.add(resourceIdentifier, resource);
- RefPtr<Ewk_Url_Request> request = Ewk_Url_Request::create(wkRequest);
- ewk_view_resource_load_initiated(resourceLoadClient->m_view, resource.get(), request.get());
+ RefPtr<Ewk_Url_Request> request = EwkUrlRequest::create(wkRequest);
+ Ewk_Resource_Request resourceRequest = {resource.get(), request.get(), 0};
+ resourceLoadClient->m_viewImpl->smartCallback<ResourceLoadStarted>().call(&resourceRequest);
}
void ResourceLoadClientEfl::didSendRequestForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLRequestRef wkRequest, WKURLResponseRef wkRedirectResponse, const void* clientInfo)
@@ -67,9 +71,10 @@ void ResourceLoadClientEfl::didSendRequestForResource(WKPageRef, WKFrameRef, uin
if (!resource)
return;
- RefPtr<Ewk_Url_Request> request = Ewk_Url_Request::create(wkRequest);
- RefPtr<Ewk_Url_Response> redirectResponse = Ewk_Url_Response::create(wkRedirectResponse);
- ewk_view_resource_request_sent(resourceLoadClient->m_view, resource.get(), request.get(), redirectResponse.get());
+ RefPtr<Ewk_Url_Request> request = EwkUrlRequest::create(wkRequest);
+ RefPtr<Ewk_Url_Response> redirectResponse = EwkUrlResponse::create(wkRedirectResponse);
+ Ewk_Resource_Request resourceRequest = {resource.get(), request.get(), redirectResponse.get()};
+ resourceLoadClient->m_viewImpl->smartCallback<ResourceRequestSent>().call(&resourceRequest);
}
void ResourceLoadClientEfl::didReceiveResponseForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLResponseRef wkResponse, const void* clientInfo)
@@ -81,8 +86,9 @@ void ResourceLoadClientEfl::didReceiveResponseForResource(WKPageRef, WKFrameRef,
if (!resource)
return;
- RefPtr<Ewk_Url_Response> response = Ewk_Url_Response::create(wkResponse);
- ewk_view_resource_load_response(resourceLoadClient->m_view, resource.get(), response.get());
+ RefPtr<Ewk_Url_Response> response = EwkUrlResponse::create(wkResponse);
+ Ewk_Resource_Load_Response resourceLoadResponse = {resource.get(), response.get()};
+ resourceLoadClient->m_viewImpl->smartCallback<ResourceLoadResponse>().call(&resourceLoadResponse);
}
void ResourceLoadClientEfl::didFinishLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, const void* clientInfo)
@@ -94,7 +100,7 @@ void ResourceLoadClientEfl::didFinishLoadForResource(WKPageRef, WKFrameRef, uint
if (!resource)
return;
- ewk_view_resource_load_finished(resourceLoadClient->m_view, resource.get());
+ resourceLoadClient->m_viewImpl->smartCallback<ResourceLoadFinished>().call(resource.get());
}
void ResourceLoadClientEfl::didFailLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKErrorRef wkError, const void* clientInfo)
@@ -107,8 +113,9 @@ void ResourceLoadClientEfl::didFailLoadForResource(WKPageRef, WKFrameRef, uint64
return;
OwnPtr<Ewk_Error> ewkError = Ewk_Error::create(wkError);
- ewk_view_resource_load_failed(resourceLoadClient->m_view, resource.get(), ewkError.get());
- ewk_view_resource_load_finished(resourceLoadClient->m_view, resource.get());
+ Ewk_Resource_Load_Error resourceLoadError = {resource.get(), ewkError.get()};
+ resourceLoadClient->m_viewImpl->smartCallback<ResourceLoadFailed>().call(&resourceLoadError);
+ resourceLoadClient->m_viewImpl->smartCallback<ResourceLoadFinished>().call(resource.get());
}
void ResourceLoadClientEfl::onViewProvisionalLoadStarted(void* userData, Evas_Object*, void*)
@@ -119,13 +126,13 @@ void ResourceLoadClientEfl::onViewProvisionalLoadStarted(void* userData, Evas_Ob
resourceLoadClient->m_loadingResourcesMap.clear();
}
-ResourceLoadClientEfl::ResourceLoadClientEfl(Evas_Object* view)
- : m_view(view)
+ResourceLoadClientEfl::ResourceLoadClientEfl(EwkViewImpl* viewImpl)
+ : m_viewImpl(viewImpl)
{
// Listen for "load,provisional,started" on the view to clear internal resources map.
- evas_object_smart_callback_add(m_view, "load,provisional,started", onViewProvisionalLoadStarted, this);
+ evas_object_smart_callback_add(m_viewImpl->view(), CallBackInfo<ProvisionalLoadStarted>::name(), onViewProvisionalLoadStarted, this);
- WKPageRef pageRef = ewk_view_wkpage_get(m_view);
+ WKPageRef pageRef = m_viewImpl->wkPage();
ASSERT(pageRef);
WKPageResourceLoadClient wkResourceLoadClient;
@@ -143,7 +150,7 @@ ResourceLoadClientEfl::ResourceLoadClientEfl(Evas_Object* view)
ResourceLoadClientEfl::~ResourceLoadClientEfl()
{
- evas_object_smart_callback_del(m_view, "load,provisional,started", onViewProvisionalLoadStarted);
+ evas_object_smart_callback_del(m_viewImpl->view(), CallBackInfo<ProvisionalLoadStarted>::name(), onViewProvisionalLoadStarted);
}
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h b/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h
index 58f52b4b7..7a5525b6a 100644
--- a/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h
+++ b/Source/WebKit2/UIProcess/efl/ResourceLoadClientEfl.h
@@ -27,23 +27,24 @@
#define ResourceLoadClientEfl_h
#include "ewk_resource_private.h"
-#include "ewk_view_private.h"
#include <wtf/HashMap.h>
#include <wtf/PassOwnPtr.h>
+class EwkViewImpl;
+
namespace WebKit {
class ResourceLoadClientEfl {
public:
~ResourceLoadClientEfl();
- static PassOwnPtr<ResourceLoadClientEfl> create(Evas_Object* view)
+ static PassOwnPtr<ResourceLoadClientEfl> create(EwkViewImpl* viewImpl)
{
- return adoptPtr(new ResourceLoadClientEfl(view));
+ return adoptPtr(new ResourceLoadClientEfl(viewImpl));
}
private:
- explicit ResourceLoadClientEfl(Evas_Object* view);
+ explicit ResourceLoadClientEfl(EwkViewImpl*);
static void didInitiateLoadForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLRequestRef, bool pageIsProvisionallyLoading, const void* clientInfo);
static void didSendRequestForResource(WKPageRef, WKFrameRef, uint64_t resourceIdentifier, WKURLRequestRef, WKURLResponseRef, const void* clientInfo);
@@ -53,7 +54,7 @@ private:
static void onViewProvisionalLoadStarted(void* userData, Evas_Object* view, void* clientInfo);
- Evas_Object* m_view;
+ EwkViewImpl* m_viewImpl;
HashMap< uint64_t, RefPtr<Ewk_Resource> > m_loadingResourcesMap;
};
diff --git a/Source/WebKit2/UIProcess/efl/VibrationProvider.cpp b/Source/WebKit2/UIProcess/efl/VibrationProvider.cpp
new file mode 100644
index 000000000..2de62968c
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/VibrationProvider.cpp
@@ -0,0 +1,117 @@
+/*
+ * 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 "VibrationProvider.h"
+
+#if ENABLE(VIBRATION)
+
+#include "WKAPICast.h"
+#include "WKContext.h"
+#include "WKVibration.h"
+#include <Evas.h>
+
+using namespace WebCore;
+using namespace WebKit;
+
+/**
+ * \struct Ewk_Vibration_Client
+ * @brief Contains the vibration client callbacks.
+ */
+struct Ewk_Vibration_Client {
+ Ewk_Vibration_Client_Vibrate_Cb vibrate;
+ Ewk_Vibration_Client_Vibration_Cancel_Cb cancelVibration;
+ void* userData;
+
+ Ewk_Vibration_Client(Ewk_Vibration_Client_Vibrate_Cb vibrate, Ewk_Vibration_Client_Vibration_Cancel_Cb cancelVibration, void* userData)
+ : vibrate(vibrate)
+ , cancelVibration(cancelVibration)
+ , userData(userData)
+ { }
+};
+
+static inline VibrationProvider* toVibrationProvider(const void* clientInfo)
+{
+ return static_cast<VibrationProvider*>(const_cast<void*>(clientInfo));
+}
+
+static void vibrateCallback(WKVibrationRef, uint64_t vibrationTime, const void* clientInfo)
+{
+ toVibrationProvider(clientInfo)->vibrate(vibrationTime);
+}
+
+static void cancelVibrationCallback(WKVibrationRef, const void* clientInfo)
+{
+ toVibrationProvider(clientInfo)->cancelVibration();
+}
+
+PassRefPtr<VibrationProvider> VibrationProvider::create(WKContextRef wkContext)
+{
+ return adoptRef(new VibrationProvider(wkContext));
+}
+
+VibrationProvider::VibrationProvider(WKContextRef wkContext)
+ : m_wkContext(wkContext)
+{
+ ASSERT(m_wkContext.get());
+
+ WKVibrationRef wkVibration = WKContextGetVibration(m_wkContext.get());
+ ASSERT(wkVibration);
+
+ WKVibrationProvider wkVibrationProvider = {
+ kWKVibrationProviderCurrentVersion,
+ this, // clientInfo
+ vibrateCallback,
+ cancelVibrationCallback
+ };
+ WKVibrationSetProvider(wkVibration, &wkVibrationProvider);
+}
+
+VibrationProvider::~VibrationProvider()
+{
+ WKVibrationRef wkVibration = WKContextGetVibration(m_wkContext.get());
+ ASSERT(wkVibration);
+
+ WKVibrationSetProvider(wkVibration, 0);
+}
+
+void VibrationProvider::vibrate(uint64_t vibrationTime)
+{
+ if (m_vibrationClient && m_vibrationClient->vibrate)
+ m_vibrationClient->vibrate(vibrationTime, m_vibrationClient->userData);
+}
+
+void VibrationProvider::cancelVibration()
+{
+ if (m_vibrationClient && m_vibrationClient->cancelVibration)
+ m_vibrationClient->cancelVibration(m_vibrationClient->userData);
+}
+
+void VibrationProvider::setVibrationClientCallbacks(Ewk_Vibration_Client_Vibrate_Cb vibrate, Ewk_Vibration_Client_Vibration_Cancel_Cb cancelVibration, void* data)
+{
+ m_vibrationClient = adoptPtr(new Ewk_Vibration_Client(vibrate, cancelVibration, data));
+}
+
+#endif // ENABLE(VIBRATION)
diff --git a/Source/WebKit2/UIProcess/efl/VibrationProvider.h b/Source/WebKit2/UIProcess/efl/VibrationProvider.h
new file mode 100644
index 000000000..5810393de
--- /dev/null
+++ b/Source/WebKit2/UIProcess/efl/VibrationProvider.h
@@ -0,0 +1,60 @@
+/*
+ * 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 VibrationProvider_h
+#define VibrationProvider_h
+
+#if ENABLE(VIBRATION)
+
+#include "WKRetainPtr.h"
+#include "ewk_context.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefCounted.h>
+
+typedef struct Ewk_Vibration_Client Ewk_Vibration_Client;
+
+namespace WebKit {
+
+class VibrationProvider : public RefCounted<VibrationProvider> {
+public:
+ static PassRefPtr<VibrationProvider> create(WKContextRef);
+ virtual ~VibrationProvider();
+
+ void vibrate(uint64_t vibrationTime);
+ void cancelVibration();
+ void setVibrationClientCallbacks(Ewk_Vibration_Client_Vibrate_Cb, Ewk_Vibration_Client_Vibration_Cancel_Cb, void*);
+
+private:
+ explicit VibrationProvider(WKContextRef);
+
+ WKRetainPtr<WKContextRef> m_wkContext;
+ OwnPtr<Ewk_Vibration_Client> m_vibrationClient;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(VIBRATION)
+
+#endif // VibrationProvider_h
diff --git a/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp b/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp
index d53f83560..d43145caf 100644
--- a/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/WebContextEfl.cpp
@@ -28,6 +28,7 @@
#include <Efreet.h>
#include <WebCore/ApplicationCacheStorage.h>
+#include <WebCore/IconDatabase.h>
#include <WebCore/NotImplemented.h>
namespace WebKit {
@@ -54,7 +55,7 @@ String WebContext::platformDefaultDatabaseDirectory() const
String WebContext::platformDefaultIconDatabasePath() const
{
- return String::fromUTF8(efreet_data_home_get()) + "/WebKitEfl/IconDatabase";
+ return String::fromUTF8(efreet_data_home_get()) + "/WebKitEfl/IconDatabase/" + WebCore::IconDatabase::defaultDatabaseFilename();
}
String WebContext::platformDefaultLocalStorageDirectory() const
diff --git a/Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp
index 254340de5..468cbf884 100644
--- a/Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp
@@ -25,10 +25,10 @@
#include "config.h"
#include "WebFullScreenManagerProxy.h"
-#include "ewk_view_private.h"
#if ENABLE(FULLSCREEN_API)
+#include "EwkViewImpl.h"
#include <WebCore/NotImplemented.h>
using namespace WebCore;
@@ -57,7 +57,7 @@ void WebFullScreenManagerProxy::enterFullScreen()
return;
willEnterFullScreen();
- ewk_view_full_screen_enter(m_webView);
+ EwkViewImpl::fromEvasObject(m_webView)->enterFullScreen();
didEnterFullScreen();
}
@@ -66,8 +66,9 @@ void WebFullScreenManagerProxy::exitFullScreen()
if (!m_webView)
return;
+
willExitFullScreen();
- ewk_view_full_screen_exit(m_webView);
+ EwkViewImpl::fromEvasObject(m_webView)->exitFullScreen();
didExitFullScreen();
}
diff --git a/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp
index ffd6aa5f9..82f83c86d 100644
--- a/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/WebInspectorProxyEfl.cpp
@@ -28,6 +28,7 @@
#if ENABLE(INSPECTOR)
+#include "EwkViewImpl.h"
#include "WebProcessProxy.h"
#include "ewk_settings.h"
#include "ewk_view.h"
@@ -86,17 +87,23 @@ WebPageProxy* WebInspectorProxy::platformCreateInspectorPage()
{
ASSERT(m_page);
+#if USE(ACCELERATED_COMPOSITING) && defined HAVE_ECORE_X
+ const char* engine = "opengl_x11";
+ m_inspectorWindow = ecore_evas_new(engine, 0, 0, initialWindowWidth, initialWindowHeight, 0);
+#else
m_inspectorWindow = ecore_evas_new(0, 0, 0, initialWindowWidth, initialWindowHeight, 0);
+#endif
if (!m_inspectorWindow)
return 0;
m_inspectorView = ewk_view_base_add(ecore_evas_get(m_inspectorWindow), toAPI(page()->process()->context()), toAPI(inspectorPageGroup()));
- ewk_view_theme_set(m_inspectorView, TEST_THEME_DIR"/default.edj");
+ EwkViewImpl* inspectorViewImpl = EwkViewImpl::fromEvasObject(m_inspectorView);
+ inspectorViewImpl->setThemePath(TEST_THEME_DIR "/default.edj");
- Ewk_Settings* settings = ewk_view_settings_get(m_inspectorView);
+ Ewk_Settings* settings = inspectorViewImpl->settings();
ewk_settings_file_access_from_file_urls_allowed_set(settings, true);
- return ewk_view_page_get(m_inspectorView);
+ return inspectorViewImpl->page();
}
void WebInspectorProxy::platformOpen()
diff --git a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
index 8981ceeb1..befa247c2 100644
--- a/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/WebPageProxyEfl.cpp
@@ -26,8 +26,10 @@
#include "config.h"
#include "WebPageProxy.h"
+#include "EwkViewImpl.h"
+#include "NativeWebKeyboardEvent.h"
#include "NotImplemented.h"
-#include "PageClientImpl.h"
+#include "PageClientBase.h"
#include "WebKitVersion.h"
#include "WebPageMessages.h"
#include "WebProcessProxy.h"
@@ -38,7 +40,7 @@ namespace WebKit {
Evas_Object* WebPageProxy::viewWidget()
{
- return static_cast<PageClientImpl*>(m_pageClient)->viewWidget();
+ return static_cast<PageClientBase*>(m_pageClient)->viewImpl()->view();
}
String WebPageProxy::standardUserAgent(const String& /*applicationNameForUserAgent*/)
@@ -93,4 +95,33 @@ void WebPageProxy::windowedPluginGeometryDidChange(const WebCore::IntRect&, cons
notImplemented();
}
+void WebPageProxy::handleInputMethodKeydown(bool& handled)
+{
+ handled = m_keyEventQueue.first().isFiltered();
+}
+
+void WebPageProxy::confirmComposition(const String& compositionString)
+{
+ if (!isValid())
+ return;
+
+ process()->send(Messages::WebPage::ConfirmComposition(compositionString), m_pageID, 0);
+}
+
+void WebPageProxy::setComposition(const String& compositionString, Vector<WebCore::CompositionUnderline>& underlines, int cursorPosition)
+{
+ if (!isValid())
+ return;
+
+ process()->send(Messages::WebPage::SetComposition(compositionString, underlines, cursorPosition), m_pageID, 0);
+}
+
+void WebPageProxy::cancelComposition()
+{
+ if (!isValid())
+ return;
+
+ process()->send(Messages::WebPage::CancelComposition(), m_pageID, 0);
+}
+
} // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/WebPopupMenuProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebPopupMenuProxyEfl.cpp
index 03d504ba4..f5b104d9f 100644
--- a/Source/WebKit2/UIProcess/efl/WebPopupMenuProxyEfl.cpp
+++ b/Source/WebKit2/UIProcess/efl/WebPopupMenuProxyEfl.cpp
@@ -26,30 +26,30 @@
#include "config.h"
#include "WebPopupMenuProxyEfl.h"
+#include "EwkViewImpl.h"
#include "NativeWebMouseEvent.h"
#include "WebPopupItem.h"
#include "ewk_view.h"
-#include "ewk_view_private.h"
#include <wtf/text/CString.h>
using namespace WebCore;
namespace WebKit {
-WebPopupMenuProxyEfl::WebPopupMenuProxyEfl(Evas_Object* webView, WebPopupMenuProxy::Client* client)
+WebPopupMenuProxyEfl::WebPopupMenuProxyEfl(EwkViewImpl* viewImpl, WebPopupMenuProxy::Client* client)
: WebPopupMenuProxy(client)
- , m_webView(webView)
+ , m_viewImpl(viewImpl)
{
}
void WebPopupMenuProxyEfl::showPopupMenu(const IntRect& rect, TextDirection textDirection, double pageScaleFactor, const Vector<WebPopupItem>& items, const PlatformPopupMenuData&, int32_t selectedIndex)
{
- ewk_view_popup_menu_request(m_webView, this, rect, textDirection, pageScaleFactor, items, selectedIndex);
+ m_viewImpl->requestPopupMenu(this, rect, textDirection, pageScaleFactor, items, selectedIndex);
}
void WebPopupMenuProxyEfl::hidePopupMenu()
{
- ewk_view_popup_menu_close(m_webView);
+ m_viewImpl->closePopupMenu();
}
void WebPopupMenuProxyEfl::valueChanged(int newSelectedIndex)
diff --git a/Source/WebKit2/UIProcess/efl/WebPopupMenuProxyEfl.h b/Source/WebKit2/UIProcess/efl/WebPopupMenuProxyEfl.h
index ab4074ab2..e4edb9635 100644
--- a/Source/WebKit2/UIProcess/efl/WebPopupMenuProxyEfl.h
+++ b/Source/WebKit2/UIProcess/efl/WebPopupMenuProxyEfl.h
@@ -34,15 +34,17 @@ namespace WebCore {
class IntRect;
}
+class EwkViewImpl;
+
namespace WebKit {
class WebPageProxy;
class WebPopupMenuProxyEfl : public WebPopupMenuProxy {
public:
- static PassRefPtr<WebPopupMenuProxyEfl> create(Evas_Object* webView, WebPopupMenuProxy::Client* client)
+ static PassRefPtr<WebPopupMenuProxyEfl> create(EwkViewImpl* viewImpl, WebPopupMenuProxy::Client* client)
{
- return adoptRef(new WebPopupMenuProxyEfl(webView, client));
+ return adoptRef(new WebPopupMenuProxyEfl(viewImpl, client));
}
void showPopupMenu(const WebCore::IntRect&, WebCore::TextDirection, double pageScaleFactor, const Vector<WebPopupItem>&, const PlatformPopupMenuData&, int32_t selectedIndex);
@@ -51,9 +53,9 @@ public:
void valueChanged(int newSelectedIndex);
private:
- WebPopupMenuProxyEfl(Evas_Object*, WebPopupMenuProxy::Client*);
+ WebPopupMenuProxyEfl(EwkViewImpl*, WebPopupMenuProxy::Client*);
- Evas_Object* m_webView;
+ EwkViewImpl* m_viewImpl;
};
} // namespace WebKit