[EFL][WK2] Move FullScreenManager logic to WebViewEfl
authorryuan.choi@samsung.com <ryuan.choi@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Dec 2013 07:46:56 +0000 (07:46 +0000)
committerryuan.choi@samsung.com <ryuan.choi@samsung.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 Dec 2013 07:46:56 +0000 (07:46 +0000)
https://bugs.webkit.org/show_bug.cgi?id=125438

Reviewed by Gyuyoung Kim.

This patch fixed build break on EFL port Since r160296.

* PlatformEfl.cmake: Removed WebFullScreenManagerProxyEfl.cpp.
* UIProcess/WebFullScreenManagerProxy.cpp: Removed EFL specific code.
(WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
* UIProcess/WebFullScreenManagerProxy.h: Ditto.
* UIProcess/efl/WebFullScreenManagerProxyEfl.cpp: Removed file and moved logic to WebViewEfl.
* UIProcess/efl/WebViewEfl.cpp:
(WebKit::WebViewEfl::WebViewEfl):
(WebKit::WebViewEfl::setEwkView): Removed call to setWebView().
(WebKit::WebViewEfl::fullScreenManagerProxyClient):
(WebKit::WebViewEfl::isFullScreen):
(WebKit::WebViewEfl::enterFullScreen):
(WebKit::WebViewEfl::exitFullScreen):
* UIProcess/efl/WebViewEfl.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/PlatformEfl.cmake
Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp
Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h
Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp [deleted file]
Source/WebKit2/UIProcess/efl/WebViewEfl.cpp
Source/WebKit2/UIProcess/efl/WebViewEfl.h

index 3ee0b63..f1f4bf8 100644 (file)
@@ -1,3 +1,26 @@
+2013-12-08  Ryuan Choi  <ryuan.choi@samsung.com>
+
+        [EFL][WK2] Move FullScreenManager logic to WebViewEfl
+        https://bugs.webkit.org/show_bug.cgi?id=125438
+
+        Reviewed by Gyuyoung Kim.
+
+        This patch fixed build break on EFL port Since r160296.
+
+        * PlatformEfl.cmake: Removed WebFullScreenManagerProxyEfl.cpp.
+        * UIProcess/WebFullScreenManagerProxy.cpp: Removed EFL specific code.
+        (WebKit::WebFullScreenManagerProxy::WebFullScreenManagerProxy):
+        * UIProcess/WebFullScreenManagerProxy.h: Ditto.
+        * UIProcess/efl/WebFullScreenManagerProxyEfl.cpp: Removed file and moved logic to WebViewEfl.
+        * UIProcess/efl/WebViewEfl.cpp:
+        (WebKit::WebViewEfl::WebViewEfl):
+        (WebKit::WebViewEfl::setEwkView): Removed call to setWebView().
+        (WebKit::WebViewEfl::fullScreenManagerProxyClient):
+        (WebKit::WebViewEfl::isFullScreen):
+        (WebKit::WebViewEfl::enterFullScreen):
+        (WebKit::WebViewEfl::exitFullScreen):
+        * UIProcess/efl/WebViewEfl.h:
+
 2013-12-08  Sam Weinig  <sam@webkit.org>
 
         Remove WebContext::sharedProcessContext()
index 6d3e712..9f5376c 100644 (file)
@@ -147,7 +147,6 @@ list(APPEND WebKit2_SOURCES
     UIProcess/efl/ViewClientEfl.cpp
     UIProcess/efl/WebContextEfl.cpp
     UIProcess/efl/WebContextMenuProxyEfl.cpp
-    UIProcess/efl/WebFullScreenManagerProxyEfl.cpp
     UIProcess/efl/WebInspectorProxyEfl.cpp
     UIProcess/efl/WebPageProxyEfl.cpp
     UIProcess/efl/WebPopupItemEfl.cpp
index 1f374c1..cb3e6b3 100644 (file)
@@ -46,9 +46,6 @@ PassRefPtr<WebFullScreenManagerProxy> WebFullScreenManagerProxy::create(WebPageP
 WebFullScreenManagerProxy::WebFullScreenManagerProxy(WebPageProxy& page, WebFullScreenManagerProxyClient& client)
     : m_page(&page)
     , m_client(&client)
-#if PLATFORM(EFL)
-    , m_hasRequestedFullScreen(false)
-#endif
 {
     m_page->process().addMessageReceiver(Messages::WebFullScreenManagerProxy::messageReceiverName(), m_page->pageID(), this);
 }
index c6d9bc5..5f27cf6 100644 (file)
@@ -86,10 +86,6 @@ private:
 
     WebPageProxy* m_page;
     WebFullScreenManagerProxyClient* m_client;
-
-#if PLATFORM(EFL)
-    bool m_hasRequestedFullScreen;
-#endif
 };
 
 } // namespace WebKit
diff --git a/Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp b/Source/WebKit2/UIProcess/efl/WebFullScreenManagerProxyEfl.cpp
deleted file mode 100644 (file)
index 1aee1d8..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Copyright (C) 2012 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 THE COPYRIGHT HOLDERS AND 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 THE COPYRIGHT HOLDER OR
- * 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 "WebFullScreenManagerProxy.h"
-#include "WebFullScreenManagerProxyMessages.h"
-
-#if ENABLE(FULLSCREEN_API)
-
-#include "EwkView.h"
-#include <WebCore/NotImplemented.h>
-
-using namespace WebCore;
-
-namespace WebKit {
-
-void WebFullScreenManagerProxy::invalidate()
-{
-    m_page->process().removeMessageReceiver(Messages::WebFullScreenManagerProxy::messageReceiverName(), m_page->pageID());
-    m_webView = 0;
-}
-
-void WebFullScreenManagerProxy::close()
-{
-    notImplemented();
-}
-
-bool WebFullScreenManagerProxy::isFullScreen()
-{
-    return m_hasRequestedFullScreen;
-}
-
-void WebFullScreenManagerProxy::enterFullScreen()
-{
-    if (!m_webView || m_hasRequestedFullScreen)
-        return;
-
-    m_hasRequestedFullScreen = true;
-
-    willEnterFullScreen();
-    toEwkView(m_webView)->enterFullScreen();
-    didEnterFullScreen();
-}
-
-void WebFullScreenManagerProxy::exitFullScreen()
-{
-    if (!m_webView || !m_hasRequestedFullScreen)
-        return;
-
-    m_hasRequestedFullScreen = false;
-
-    willExitFullScreen();
-    toEwkView(m_webView)->exitFullScreen();
-    didExitFullScreen();
-}
-
-void WebFullScreenManagerProxy::beganEnterFullScreen(const IntRect& /*initialFrame*/, const IntRect& /*finalFrame*/)
-{
-    notImplemented();
-}
-
-void WebFullScreenManagerProxy::beganExitFullScreen(const IntRect& /*initialFrame*/, const IntRect& /*finalFrame*/)
-{
-    notImplemented();
-}
-
-} // namespace WebKit
-
-#endif // ENABLE(FULLSCREEN_API)
index 22ee646..5f08181 100644 (file)
@@ -57,16 +57,13 @@ PassRefPtr<WebView> WebView::create(WebContext* context, WebPageGroup* pageGroup
 WebViewEfl::WebViewEfl(WebContext* context, WebPageGroup* pageGroup)
     : WebView(context, pageGroup)
     , m_ewkView(0)
+    , m_hasRequestedFullScreen(false)
 {
 }
 
 void WebViewEfl::setEwkView(EwkView* ewkView)
 {
     m_ewkView = ewkView;
-
-#if ENABLE(FULLSCREEN_API)
-    m_page->fullScreenManager()->setWebView(ewkView->evasObject());
-#endif
 }
 
 void WebViewEfl::paintToCairoSurface(cairo_surface_t* surface)
@@ -143,4 +140,45 @@ void WebViewEfl::sendMouseEvent(const Evas_Event_Mouse_Move* event)
     m_page->handleMouseEvent(NativeWebMouseEvent(event, transformFromScene(), m_userViewportTransform.toAffineTransform()));
 }
 
+#if ENABLE(FULLSCREEN_API)
+
+WebFullScreenManagerProxyClient& WebViewEfl::fullScreenManagerProxyClient()
+{
+    return *this;
+}
+
+// WebFullScreenManagerProxyClient
+bool WebViewEfl::isFullScreen()
+{
+    return m_hasRequestedFullScreen;
+}
+
+void WebViewEfl::enterFullScreen()
+{
+    if (!m_ewkView || m_hasRequestedFullScreen)
+        return;
+
+    m_hasRequestedFullScreen = true;
+
+    WebFullScreenManagerProxy* manager = m_page->fullScreenManager();
+    manager->willEnterFullScreen();
+    m_ewkView->enterFullScreen();
+    manager->didEnterFullScreen();
+}
+
+void WebViewEfl::exitFullScreen()
+{
+    if (!m_ewkView || !m_hasRequestedFullScreen)
+        return;
+
+    m_hasRequestedFullScreen = false;
+
+    WebFullScreenManagerProxy* manager = m_page->fullScreenManager();
+    manager->willExitFullScreen();
+    m_ewkView->exitFullScreen();
+    manager->didExitFullScreen();
+}
+
+#endif // ENABLE(FULLSCREEN_API)
+
 } // namespace WebKit
index 8ab9288..ba1e870 100644 (file)
@@ -26,6 +26,7 @@
 #ifndef WebViewEfl_h
 #define WebViewEfl_h
 
+#include "WebFullScreenManagerProxy.h"
 #include "WebView.h"
 
 class EwkView;
@@ -36,7 +37,11 @@ namespace WebKit {
 class EwkTouchEvent;
 #endif
 
-class WebViewEfl : public WebView {
+class WebViewEfl : public WebView
+#if ENABLE(FULLSCREEN_API)
+    , public WebFullScreenManagerProxyClient
+#endif
+    {
 public:
     void setEwkView(EwkView*);
     EwkView* ewkView() { return m_ewkView; }
@@ -60,8 +65,23 @@ private:
     void updateTextInputState() OVERRIDE;
     void handleDownloadRequest(DownloadProxy*) OVERRIDE;
 
+#if ENABLE(FULLSCREEN_API)
+    WebFullScreenManagerProxyClient& fullScreenManagerProxyClient() OVERRIDE;
+#endif
+
+#if ENABLE(FULLSCREEN_API)
+    // WebFullScreenManagerProxyClient
+    virtual void closeFullScreenManager() OVERRIDE FINAL { }
+    virtual bool isFullScreen() OVERRIDE FINAL;
+    virtual void enterFullScreen() OVERRIDE FINAL;
+    virtual void exitFullScreen() OVERRIDE FINAL;
+    virtual void beganEnterFullScreen(const WebCore::IntRect&, const WebCore::IntRect&) OVERRIDE FINAL { }
+    virtual void beganExitFullScreen(const WebCore::IntRect&, const WebCore::IntRect&) OVERRIDE FINAL { }
+#endif
+
 private:
     EwkView* m_ewkView;
+    bool m_hasRequestedFullScreen;
 
     friend class WebView;
 };