2011-03-08 Jer Noble <jer.noble@apple.com>
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Mar 2011 05:19:38 +0000 (05:19 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Mar 2011 05:19:38 +0000 (05:19 +0000)
        Reviewed by Sam Weinig.

        WebKit2: Plumb through the FULLSCREEN_API Chrome client calls
        https://bugs.webkit.org/show_bug.cgi?id=55273

        The FULLSCREEN_API Chrome client calls need to be plumbed through from the
        WebProcess to the UIProcess.  To do this, WebFullScreenManager (and Proxy)
        classes have been added to WebPage.

        * DerivedSources.make: Added rules necessary to build DerivedSources for new .in files.
        * DerivedSources.pro: Ditto.
        * Platform/CoreIPC/MessageID.h: Added message types for WebFullScreenManager.
        * Shared/API/c/WKBase.h: Added WKFullScreenManagerRef.
        * Shared/APIObject.h: Added APIType for WebFullScreenManager.
        * UIProcess/WebFullScreenManagerProxy.cpp: Added.
        * UIProcess/WebFullScreenManagerProxy.h: Added.
        * UIProcess/WebFullScreenManagerProxy.messages.in: Added.
        * UIProcess/WebPageProxy.cpp:
        (WebKit::WebPageProxy::close): Invalidate and clear m_fullScreenManager.
        (WebKit::WebPageProxy::processDidCrash): Ditto.
        (WebKit::WebPageProxy::didReceiveMessage): Pass messages on to WebFullScreenManagerProxy.
        (WebKit::WebPageProxy::didReceiveSyncMessage): Ditto.
        (WebKit::WebPageProxy::fullScreenManager): Added. Lazy instantiation of m_fullScreenManager.
        * UIProcess/WebPageProxy.h:
        * UIProcess/WebPageProxy.messages.in:
        * UIProcess/WebUIClient.cpp:
        * UIProcess/WebUIClient.h:
        * WebKit2.xcodeproj/project.pbxproj: Added references to new classes in project file.
        * WebKit2.pro: Ditto.
        * win/WebKit2.vcproj: Ditto.
        * WebKit2.pri: Added new directories to include file path.
        * win/WebKit2Common.vsprops: Ditto.
        * WebProcess/FullScreen/WebFullScreenManager.cpp: Added.
        * WebProcess/FullScreen/WebFullScreenManager.h: Added.
        * WebProcess/FullScreen/WebFullScreenManager.messages.in: Added.
        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
        (WebKit::WebChromeClient::supportsFullScreenForElement): Pass through to WebFullScreenManager.
        (WebKit::WebChromeClient::enterFullScreenForElement): Ditto.
        (WebKit::WebChromeClient::exitFullScreenForElement): Ditto.
        * WebProcess/WebPage/WebPage.cpp:
        (WebKit::WebPage::close): Invalidate and clear m_fullScreenManager.
        (WebKit::WebPage::fullScreenManager): Lazy instantiation of m_fullScreenManager.
        (WebKit::WebPage::didReceiveMessage): Pass messages through to WebFullScreenManager.
        * WebProcess/WebPage/WebPage.h:

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

22 files changed:
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/DerivedSources.pro
Source/WebKit2/Platform/CoreIPC/MessageID.h
Source/WebKit2/Shared/APIObject.h
Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp [new file with mode: 0644]
Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h [new file with mode: 0644]
Source/WebKit2/UIProcess/WebFullScreenManagerProxy.messages.in [new file with mode: 0644]
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/WebKit2.pri
Source/WebKit2/WebKit2.pro
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp [new file with mode: 0644]
Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h [new file with mode: 0644]
Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.messages.in [new file with mode: 0644]
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/win/WebKit2.vcproj
Source/WebKit2/win/WebKit2Common.vsprops

index 4db2db6..17fba39 100644 (file)
@@ -2,6 +2,53 @@
 
         Reviewed by Sam Weinig.
 
+        WebKit2: Plumb through the FULLSCREEN_API Chrome client calls
+        https://bugs.webkit.org/show_bug.cgi?id=55273
+
+        The FULLSCREEN_API Chrome client calls need to be plumbed through from the 
+        WebProcess to the UIProcess.  To do this, WebFullScreenManager (and Proxy)
+        classes have been added to WebPage.
+
+        * DerivedSources.make: Added rules necessary to build DerivedSources for new .in files.
+        * DerivedSources.pro: Ditto.
+        * Platform/CoreIPC/MessageID.h: Added message types for WebFullScreenManager.
+        * Shared/API/c/WKBase.h: Added WKFullScreenManagerRef.
+        * Shared/APIObject.h: Added APIType for WebFullScreenManager.
+        * UIProcess/WebFullScreenManagerProxy.cpp: Added.
+        * UIProcess/WebFullScreenManagerProxy.h: Added.
+        * UIProcess/WebFullScreenManagerProxy.messages.in: Added.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::close): Invalidate and clear m_fullScreenManager.
+        (WebKit::WebPageProxy::processDidCrash): Ditto.
+        (WebKit::WebPageProxy::didReceiveMessage): Pass messages on to WebFullScreenManagerProxy.
+        (WebKit::WebPageProxy::didReceiveSyncMessage): Ditto.
+        (WebKit::WebPageProxy::fullScreenManager): Added. Lazy instantiation of m_fullScreenManager.
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/WebUIClient.cpp:
+        * UIProcess/WebUIClient.h:
+        * WebKit2.xcodeproj/project.pbxproj: Added references to new classes in project file.
+        * WebKit2.pro: Ditto.
+        * win/WebKit2.vcproj: Ditto.
+        * WebKit2.pri: Added new directories to include file path.
+        * win/WebKit2Common.vsprops: Ditto.
+        * WebProcess/FullScreen/WebFullScreenManager.cpp: Added.
+        * WebProcess/FullScreen/WebFullScreenManager.h: Added.
+        * WebProcess/FullScreen/WebFullScreenManager.messages.in: Added.
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::supportsFullScreenForElement): Pass through to WebFullScreenManager.
+        (WebKit::WebChromeClient::enterFullScreenForElement): Ditto.
+        (WebKit::WebChromeClient::exitFullScreenForElement): Ditto.
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::close): Invalidate and clear m_fullScreenManager.
+        (WebKit::WebPage::fullScreenManager): Lazy instantiation of m_fullScreenManager.
+        (WebKit::WebPage::didReceiveMessage): Pass messages through to WebFullScreenManager.
+        * WebProcess/WebPage/WebPage.h:
+
+2011-03-08  Jer Noble  <jer.noble@apple.com>
+
+        Reviewed by Sam Weinig.
+
         WebKit2: Plumb through the "supportsFullScreen" preference.
         https://bugs.webkit.org/show_bug.cgi?id=55261
 
index 40a9b7a..71876d8 100644 (file)
@@ -26,6 +26,7 @@ VPATH = \
     $(WebKit2)/WebProcess/ApplicationCache \
     $(WebKit2)/WebProcess/Authentication \
     $(WebKit2)/WebProcess/Cookies \
+    $(WebKit2)/WebProcess/FullScreen \
     $(WebKit2)/WebProcess/Geolocation \
     $(WebKit2)/WebProcess/KeyValueStorage \
     $(WebKit2)/WebProcess/Plugins \
@@ -55,6 +56,8 @@ MESSAGE_RECEIVERS = \
     WebContext \
     WebDatabaseManager \
     WebDatabaseManagerProxy \
+    WebFullScreenManager \
+    WebFullScreenManagerProxy \
     WebGeolocationManager \
     WebGeolocationManagerProxy \
     WebInspector \
index 3af0549..4190d93 100644 (file)
@@ -78,6 +78,7 @@ VPATH = \
     WebProcess/ApplicationCache \
     WebProcess/Authentication \
     WebProcess/Cookies \
+    WebProcess/FullScreen \
     WebProcess/Geolocation \
     WebProcess/KeyValueStorage \
     WebProcess/Plugins \
@@ -109,6 +110,8 @@ MESSAGE_RECEIVERS = \
     WebInspectorProxy.messages.in \
     WebKeyValueStorageManager.messages.in \
     WebKeyValueStorageManagerProxy.messages.in \
+    WebFullScreenManager.messages.in \
+    WebFullScreenManagerProxy.messages.in \
     WebPage/WebInspector.messages.in \
     WebPage/WebPage.messages.in \
     WebPageProxy.messages.in \
index 83154ec..af89de1 100644 (file)
@@ -42,6 +42,7 @@ enum MessageClass {
     MessageClassWebApplicationCacheManager,
     MessageClassWebCookieManager,
     MessageClassWebDatabaseManager,
+    MessageClassWebFullScreenManager,
     MessageClassWebGeolocationManagerProxy,
     MessageClassWebInspector,
     MessageClassWebKeyValueStorageManager,
@@ -58,6 +59,7 @@ enum MessageClass {
     MessageClassWebContextLegacy,
     MessageClassWebCookieManagerProxy,
     MessageClassWebDatabaseManagerProxy,
+    MessageClassWebFullScreenManagerProxy,
     MessageClassWebGeolocationManager,
     MessageClassWebInspectorProxy,
     MessageClassWebKeyValueStorageManagerProxy,
index 0384788..dcc5a09 100644 (file)
@@ -72,6 +72,7 @@ public:
         TypeFormSubmissionListener,
         TypeFrame,
         TypeFramePolicyListener,
+        TypeFullScreenManager,
         TypeGeolocationManager,
         TypeGeolocationPermissionRequest,
         TypeGeolocationPosition,
diff --git a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.cpp
new file mode 100644 (file)
index 0000000..6a8b57f
--- /dev/null
@@ -0,0 +1,101 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include "config.h"
+#include "WebFullScreenManagerProxy.h"
+
+#if ENABLE(FULLSCREEN_API)
+
+#include "WebContext.h"
+#include "WebFullScreenManagerMessages.h"
+#include "WebFullScreenManagerProxyMessages.h"
+#include "WebProcess.h"
+
+namespace WebKit {
+
+PassRefPtr<WebFullScreenManagerProxy> WebFullScreenManagerProxy::create(WebPageProxy* page)
+{
+    return adoptRef(new WebFullScreenManagerProxy(page));
+}
+
+WebFullScreenManagerProxy::WebFullScreenManagerProxy(WebPageProxy* page)
+    : m_page(page)
+{
+}
+
+WebFullScreenManagerProxy::~WebFullScreenManagerProxy()
+{
+}
+
+void WebFullScreenManagerProxy::invalidate()
+{
+}
+
+void WebFullScreenManagerProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+{
+    didReceiveWebFullScreenManagerProxyMessage(connection, messageID, arguments);
+}
+
+CoreIPC::SyncReplyMode WebFullScreenManagerProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply)
+{
+    return didReceiveSyncWebFullScreenManagerProxyMessage(connection, messageID, arguments, reply);
+}
+
+void WebFullScreenManagerProxy::willEnterFullScreen()
+{
+    m_page->process()->send(Messages::WebFullScreenManager::WillEnterFullScreen(), m_page->pageID());
+}
+
+void WebFullScreenManagerProxy::didEnterFullScreen()
+{
+    m_page->process()->send(Messages::WebFullScreenManager::DidEnterFullScreen(), m_page->pageID());
+}
+
+void WebFullScreenManagerProxy::willExitFullScreen()
+{
+    m_page->process()->send(Messages::WebFullScreenManager::WillExitFullScreen(), m_page->pageID());
+}
+
+void WebFullScreenManagerProxy::didExitFullScreen()
+{
+    m_page->process()->send(Messages::WebFullScreenManager::DidExitFullScreen(), m_page->pageID());
+}
+
+void WebFullScreenManagerProxy::supportsFullScreen(bool& supports)
+{
+    supports = true;
+}
+
+void WebFullScreenManagerProxy::enterFullScreen()
+{
+}
+
+void WebFullScreenManagerProxy::exitFullScreen()
+{
+}
+
+} // namespace WebKit
+
+#endif // ENABLE(FULLSCREEN_API)
diff --git a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.h
new file mode 100644 (file)
index 0000000..01d098f
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef WebFullScreenManagerProxy_h
+#define WebFullScreenManagerProxy_h
+
+#if ENABLE(FULLSCREEN_API)
+
+#include "Connection.h"
+#include <wtf/PassRefPtr.h>
+#include <wtf/RefPtr.h>
+
+namespace CoreIPC {
+class ArgumentDecoder;
+class Connection;
+class MessageID;
+}
+
+namespace WebKit {
+
+class WebPageProxy;
+
+class WebFullScreenManagerProxy : public RefCounted<WebFullScreenManagerProxy> {
+public:
+    static PassRefPtr<WebFullScreenManagerProxy> create(WebPageProxy*);
+    virtual ~WebFullScreenManagerProxy();
+
+    void invalidate();
+
+    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+    CoreIPC::SyncReplyMode didReceiveSyncMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply);
+
+    void willEnterFullScreen();
+    void didEnterFullScreen();
+    void willExitFullScreen();
+    void didExitFullScreen();
+
+private:
+    WebFullScreenManagerProxy(WebPageProxy*);
+
+    void supportsFullScreen(bool&);
+    void enterFullScreen();
+    void exitFullScreen();
+
+    WebPageProxy* m_page;
+
+    void didReceiveWebFullScreenManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+    CoreIPC::SyncReplyMode didReceiveSyncWebFullScreenManagerProxyMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder* arguments, CoreIPC::ArgumentEncoder* reply);
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(FULLSCREEN_API)
+
+#endif // WebFullScreenManagerProxy_h
diff --git a/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.messages.in b/Source/WebKit2/UIProcess/WebFullScreenManagerProxy.messages.in
new file mode 100644 (file)
index 0000000..dec10d3
--- /dev/null
@@ -0,0 +1,29 @@
+# Copyright (C) 2011 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#if ENABLE(FULLSCREEN_API)
+messages -> WebFullScreenManagerProxy {
+    SupportsFullScreen() -> (bool supportsFullScreen)
+    EnterFullScreen()
+    ExitFullScreen()
+}
+#endif
index 106cc27..0a39e7a 100644 (file)
@@ -297,6 +297,13 @@ void WebPageProxy::close()
     }
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+    if (m_fullScreenManager) {
+        m_fullScreenManager->invalidate();
+        m_fullScreenManager = 0;
+    }
+#endif
+
     if (m_openPanelResultListener) {
         m_openPanelResultListener->invalidate();
         m_openPanelResultListener = 0;
@@ -1257,6 +1264,13 @@ void WebPageProxy::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::M
     }
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+    if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
+        fullScreenManager()->didReceiveMessage(connection, messageID, arguments);
+        return;
+    }
+#endif
+
     didReceiveWebPageProxyMessage(connection, messageID, arguments);
 }
 
@@ -1270,6 +1284,13 @@ void WebPageProxy::didReceiveSyncMessage(CoreIPC::Connection* connection, CoreIP
     }
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+    if (messageID.is<CoreIPC::MessageClassWebFullScreenManagerProxy>()) {
+        fullScreenManager()->didReceiveSyncMessage(connection, messageID, arguments, reply);
+        return;
+    }
+#endif
+
     // FIXME: Do something with reply.
     didReceiveSyncWebPageProxyMessage(connection, messageID, arguments, reply);
 }
@@ -1988,6 +2009,15 @@ WebInspectorProxy* WebPageProxy::inspector()
 
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+WebFullScreenManagerProxy* WebPageProxy::fullScreenManager()
+{
+    if (!m_fullScreenManager)
+        m_fullScreenManager = WebFullScreenManagerProxy::create(this);
+    return m_fullScreenManager.get();
+}
+#endif
+
 // BackForwardList
 
 void WebPageProxy::backForwardAddItem(uint64_t itemID)
@@ -2587,6 +2617,13 @@ void WebPageProxy::processDidCrash()
     }
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+    if (m_fullScreenManager) {
+        m_fullScreenManager->invalidate();
+        m_fullScreenManager = 0;
+    }
+#endif
+
     if (m_openPanelResultListener) {
         m_openPanelResultListener->invalidate();
         m_openPanelResultListener = 0;
index 9bfbf84..b168988 100644 (file)
@@ -42,6 +42,7 @@
 #include "WebFindOptions.h"
 #include "WebFormClient.h"
 #include "WebFrameProxy.h"
+#include "WebFullScreenManagerProxy.h"
 #include "WebHistoryClient.h"
 #include "WebInspectorProxy.h"
 #include "WebLoaderClient.h"
@@ -182,6 +183,10 @@ public:
     WebInspectorProxy* inspector();
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+    WebFullScreenManagerProxy* fullScreenManager();
+#endif
+
     void initializeContextMenuClient(const WKPageContextMenuClient*);
     void initializeFindClient(const WKPageFindClient*);
     void initializeFormClient(const WKPageFormClient*);
@@ -670,6 +675,10 @@ private:
     RefPtr<WebInspectorProxy> m_inspector;
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+    RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
+#endif
+
     HashMap<uint64_t, RefPtr<VoidCallback> > m_voidCallbacks;
     HashMap<uint64_t, RefPtr<DataCallback> > m_dataCallbacks;
     HashMap<uint64_t, RefPtr<StringCallback> > m_stringCallbacks;
index 681f83f..3335825 100644 (file)
@@ -43,6 +43,7 @@ WEBKIT2_INCLUDEPATH = \
     $$SOURCE_DIR/WebKit2/WebProcess/Cookies \
     $$SOURCE_DIR/WebKit2/WebProcess/Downloads \
     $$SOURCE_DIR/WebKit2/WebProcess/Downloads/qt \
+    $$SOURCE_DIR/WebKit2/WebProcess/FullScreen \
     $$SOURCE_DIR/WebKit2/WebProcess/Geolocation \
     $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle \
     $$SOURCE_DIR/WebKit2/WebProcess/InjectedBundle/DOM \
index 1e7d051..572566a 100644 (file)
@@ -33,6 +33,8 @@ WEBKIT2_GENERATED_HEADERS = \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebCookieManagerProxyMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerProxyMessages.h \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebFullScreenManagerMessages.h \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebFullScreenManagerProxyMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerProxyMessages.h \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorMessages.h \
@@ -62,6 +64,8 @@ WEBKIT2_GENERATED_SOURCES = \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebCookieManagerProxyMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebDatabaseManagerProxyMessageReceiver.cpp \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebFullScreenManagerMessageReceiver.cpp \
+    $$WEBKIT2_GENERATED_SOURCES_DIR/WebFullScreenManagerProxyMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebGeolocationManagerProxyMessageReceiver.cpp \
     $$WEBKIT2_GENERATED_SOURCES_DIR/WebInspectorMessageReceiver.cpp \
@@ -190,6 +194,7 @@ HEADERS += \
     UIProcess/WebFrameListenerProxy.h \
     UIProcess/WebFramePolicyListenerProxy.h \
     UIProcess/WebFrameProxy.h \
+    UIProcess/WebFullScreenManagerProxy.h \
     UIProcess/WebGeolocationManagerProxy.h \
     UIProcess/WebGeolocationProvider.h \
     UIProcess/WebHistoryClient.h \
@@ -214,6 +219,7 @@ HEADERS += \
     WebProcess/Cookies/WebCookieManager.h \
     WebProcess/Downloads/Download.h \
     WebProcess/Downloads/DownloadManager.h \
+    WebProcess/FullScreen/WebFullScreenManager.h \
     WebProcess/Geolocation/GeolocationPermissionRequestManager.h \
     WebProcess/Geolocation/WebGeolocationManager.h \
     WebProcess/InjectedBundle/DOM/InjectedBundleNodeHandle.h \
@@ -380,6 +386,7 @@ SOURCES += \
     UIProcess/WebFrameListenerProxy.cpp \
     UIProcess/WebFramePolicyListenerProxy.cpp \
     UIProcess/WebFrameProxy.cpp \
+    UIProcess/WebFullScreenManagerProxy.cpp \
     UIProcess/WebGeolocationManagerProxy.cpp \
     UIProcess/WebGeolocationProvider.cpp \
     UIProcess/WebHistoryClient.cpp \
@@ -412,6 +419,7 @@ SOURCES += \
     WebProcess/Cookies/WebCookieManager.cpp \
     WebProcess/Downloads/Download.cpp \
     WebProcess/Downloads/DownloadManager.cpp \
+    WebProcess/FullScreen/WebFullScreenManager.cpp \
     WebProcess/Geolocation/GeolocationPermissionRequestManager.cpp \
     WebProcess/Geolocation/WebGeolocationManager.cpp \
     WebProcess/Downloads/qt/DownloadQt.cpp \
index 76679b7..9d86850 100644 (file)
                C574A37712E6099D002DFE98 /* WebDragClientMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = C554FFA212E4E8EA002F22C0 /* WebDragClientMac.mm */; };
                C574A58112E66681002DFE98 /* PasteboardTypes.h in Headers */ = {isa = PBXBuildFile; fileRef = C574A57F12E66681002DFE98 /* PasteboardTypes.h */; };
                C574A58212E66681002DFE98 /* PasteboardTypes.mm in Sources */ = {isa = PBXBuildFile; fileRef = C574A58012E66681002DFE98 /* PasteboardTypes.mm */; };
+               CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA3E131A2E8A00EEDED2 /* WebFullScreenManagerProxy.cpp */; };
+               CD73BA42131A2E8B00EEDED2 /* WebFullScreenManagerProxy.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CD73BA3F131A2E8A00EEDED2 /* WebFullScreenManagerProxy.h */; };
+               CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA45131ACC8800EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp */; };
+               CD73BA4C131ACD8F00EEDED2 /* WebFullScreenManagerMessages.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CD73BA49131ACD8E00EEDED2 /* WebFullScreenManagerMessages.h */; };
+               CD73BA4D131ACD8F00EEDED2 /* WebFullScreenManagerProxyMessages.h in CopyFiles */ = {isa = PBXBuildFile; fileRef = CD73BA4A131ACD8F00EEDED2 /* WebFullScreenManagerProxyMessages.h */; };
+               CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA48131ACD8E00EEDED2 /* WebFullScreenManagerMessageReceiver.cpp */; };
+               CD73BA53131B645B00EEDED2 /* WebFullScreenManager.cpp in Sources */ = {isa = PBXBuildFile; fileRef = CD73BA37131A29FE00EEDED2 /* WebFullScreenManager.cpp */; };
                D3B9484611FF4B6500032B39 /* WebPopupMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3B9484211FF4B6500032B39 /* WebPopupMenu.cpp */; };
                D3B9484711FF4B6500032B39 /* WebPopupMenu.h in Headers */ = {isa = PBXBuildFile; fileRef = D3B9484311FF4B6500032B39 /* WebPopupMenu.h */; };
                D3B9484811FF4B6500032B39 /* WebSearchPopupMenu.cpp in Sources */ = {isa = PBXBuildFile; fileRef = D3B9484411FF4B6500032B39 /* WebSearchPopupMenu.cpp */; };
                                1A50DB66110A3D57000D3FE5 /* WebProcess.app in CopyFiles */,
                                1A64228B12DD024700CAAE2C /* DrawingArea.messages.in in CopyFiles */,
                                6546A82C13000164000CEB1C /* InjectedBundlePageResourceLoadClient.h in CopyFiles */,
+                               CD73BA42131A2E8B00EEDED2 /* WebFullScreenManagerProxy.h in CopyFiles */,
+                               CD73BA4C131ACD8F00EEDED2 /* WebFullScreenManagerMessages.h in CopyFiles */,
+                               CD73BA4D131ACD8F00EEDED2 /* WebFullScreenManagerProxyMessages.h in CopyFiles */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
                C554FFA212E4E8EA002F22C0 /* WebDragClientMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebDragClientMac.mm; sourceTree = "<group>"; };
                C574A57F12E66681002DFE98 /* PasteboardTypes.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PasteboardTypes.h; sourceTree = "<group>"; };
                C574A58012E66681002DFE98 /* PasteboardTypes.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = PasteboardTypes.mm; sourceTree = "<group>"; };
+               CD73BA37131A29FE00EEDED2 /* WebFullScreenManager.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = WebFullScreenManager.cpp; path = FullScreen/WebFullScreenManager.cpp; sourceTree = "<group>"; };
+               CD73BA38131A29FE00EEDED2 /* WebFullScreenManager.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = WebFullScreenManager.h; path = FullScreen/WebFullScreenManager.h; sourceTree = "<group>"; };
+               CD73BA39131A29FE00EEDED2 /* WebFullScreenManager.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = WebFullScreenManager.messages.in; path = FullScreen/WebFullScreenManager.messages.in; sourceTree = "<group>"; };
+               CD73BA3E131A2E8A00EEDED2 /* WebFullScreenManagerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFullScreenManagerProxy.cpp; sourceTree = "<group>"; };
+               CD73BA3F131A2E8A00EEDED2 /* WebFullScreenManagerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFullScreenManagerProxy.h; sourceTree = "<group>"; };
+               CD73BA40131A2E8A00EEDED2 /* WebFullScreenManagerProxy.messages.in */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = WebFullScreenManagerProxy.messages.in; sourceTree = "<group>"; };
+               CD73BA45131ACC8800EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFullScreenManagerProxyMessageReceiver.cpp; sourceTree = "<group>"; };
+               CD73BA48131ACD8E00EEDED2 /* WebFullScreenManagerMessageReceiver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebFullScreenManagerMessageReceiver.cpp; sourceTree = "<group>"; };
+               CD73BA49131ACD8E00EEDED2 /* WebFullScreenManagerMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFullScreenManagerMessages.h; sourceTree = "<group>"; };
+               CD73BA4A131ACD8F00EEDED2 /* WebFullScreenManagerProxyMessages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFullScreenManagerProxyMessages.h; sourceTree = "<group>"; };
                D3B9484211FF4B6500032B39 /* WebPopupMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebPopupMenu.cpp; sourceTree = "<group>"; };
                D3B9484311FF4B6500032B39 /* WebPopupMenu.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebPopupMenu.h; sourceTree = "<group>"; };
                D3B9484411FF4B6500032B39 /* WebSearchPopupMenu.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebSearchPopupMenu.cpp; sourceTree = "<group>"; };
                BC032D5C10F436D50058C15A /* WebProcess */ = {
                        isa = PBXGroup;
                        children = (
+                               CD73BA3D131A2A2100EEDED2 /* FullScreen */,
                                512E352A130B559900ABD19A /* ApplicationCache */,
                                512F588612A8834700629530 /* Authentication */,
                                3309344B1315B93A0097A7BC /* Cookies */,
                BC032DC310F438260058C15A /* UIProcess */ = {
                        isa = PBXGroup;
                        children = (
+                               CD73BA3E131A2E8A00EEDED2 /* WebFullScreenManagerProxy.cpp */,
+                               CD73BA3F131A2E8A00EEDED2 /* WebFullScreenManagerProxy.h */,
+                               CD73BA40131A2E8A00EEDED2 /* WebFullScreenManagerProxy.messages.in */,
                                BC032DC410F4387C0058C15A /* API */,
                                512F588D12A8836F00629530 /* Authentication */,
                                51B3004D12529CF5000B5CA0 /* cf */,
                C0CE729D1247E71D00BC0EC4 /* Derived Sources */ = {
                        isa = PBXGroup;
                        children = (
+                               CD73BA48131ACD8E00EEDED2 /* WebFullScreenManagerMessageReceiver.cpp */,
+                               CD73BA49131ACD8E00EEDED2 /* WebFullScreenManagerMessages.h */,
+                               CD73BA4A131ACD8F00EEDED2 /* WebFullScreenManagerProxyMessages.h */,
+                               CD73BA45131ACC8800EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp */,
                                1A64230612DD09EB00CAAE2C /* DrawingAreaProxyMessageReceiver.cpp */,
                                1A64230712DD09EB00CAAE2C /* DrawingAreaProxyMessages.h */,
                                512F58A012A883AD00629530 /* AuthenticationManagerMessageReceiver.cpp */,
                        path = webkit2;
                        sourceTree = "<group>";
                };
+               CD73BA3D131A2A2100EEDED2 /* FullScreen */ = {
+                       isa = PBXGroup;
+                       children = (
+                               CD73BA37131A29FE00EEDED2 /* WebFullScreenManager.cpp */,
+                               CD73BA38131A29FE00EEDED2 /* WebFullScreenManager.h */,
+                               CD73BA39131A29FE00EEDED2 /* WebFullScreenManager.messages.in */,
+                       );
+                       name = FullScreen;
+                       sourceTree = "<group>";
+               };
 /* End PBXGroup section */
 
 /* Begin PBXHeadersBuildPhase section */
                                BCE81D98131AE02100241910 /* DictionaryPopupInfo.cpp in Sources */,
                                E1BB16A513201B9B00F49431 /* FullKeyboardAccessWatcher.mm in Sources */,
                                33AA1066131F060000D4A575 /* WebCookieManagerProxyClient.cpp in Sources */,
+                               CD73BA47131ACC9A00EEDED2 /* WebFullScreenManagerProxyMessageReceiver.cpp in Sources */,
+                               CD73BA4E131ACDB700EEDED2 /* WebFullScreenManagerMessageReceiver.cpp in Sources */,
+                               CD73BA53131B645B00EEDED2 /* WebFullScreenManager.cpp in Sources */,
+                               CD6F75F4131B66D000D6B21E /* WebFullScreenManagerProxy.cpp in Sources */,
                        );
                        runOnlyForDeploymentPostprocessing = 0;
                };
diff --git a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.cpp
new file mode 100644 (file)
index 0000000..b5c78ab
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#include "config.h"
+#include "WebFullScreenManager.h"
+
+#if ENABLE(FULLSCREEN_API)
+
+#include "Connection.h"
+#include "MessageID.h"
+#include "WebFullScreenManagerProxyMessages.h"
+#include "WebPage.h"
+#include "WebProcess.h"
+#include <WebCore/Page.h>
+#include <WebCore/Settings.h>
+
+using namespace WebCore;
+
+namespace WebKit {
+
+PassRefPtr<WebFullScreenManager> WebFullScreenManager::create(WebPage* page)
+{
+    return adoptRef(new WebFullScreenManager(page));
+}
+
+WebFullScreenManager::WebFullScreenManager(WebPage* page)
+    : m_page(page)
+{
+}
+
+void WebFullScreenManager::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
+{
+    didReceiveWebFullScreenManagerMessage(connection, messageID, arguments);
+}
+
+bool WebFullScreenManager::supportsFullScreen()
+{
+    if (!m_page->corePage()->settings()->fullScreenEnabled())
+        return false;
+
+    bool supports = true;
+    WebProcess::shared().connection()->sendSync(Messages::WebFullScreenManagerProxy::SupportsFullScreen(), supports, 0);
+    return supports;
+}
+
+void WebFullScreenManager::enterFullScreenForElement(WebCore::Element* element)
+{
+    ASSERT(element);
+    m_element = element;
+    WebProcess::shared().connection()->send(Messages::WebFullScreenManagerProxy::EnterFullScreen(), 0);
+}
+
+void WebFullScreenManager::exitFullScreenForElement(WebCore::Element* element)
+{
+    ASSERT(element);
+    ASSERT(m_element == element);
+    WebProcess::shared().connection()->send(Messages::WebFullScreenManagerProxy::ExitFullScreen(), 0);
+}
+
+void WebFullScreenManager::willEnterFullScreen()
+{
+    ASSERT(m_element);
+    m_element->document()->webkitWillEnterFullScreenForElement(m_element.get());
+}
+
+void WebFullScreenManager::didEnterFullScreen()
+{
+    ASSERT(m_element);
+    m_element->document()->webkitDidEnterFullScreenForElement(m_element.get());
+}
+
+void WebFullScreenManager::willExitFullScreen()
+{
+    ASSERT(m_element);
+    m_element->document()->webkitWillExitFullScreenForElement(m_element.get());
+}
+
+void WebFullScreenManager::didExitFullScreen()
+{
+    ASSERT(m_element);
+    m_element->document()->webkitDidExitFullScreenForElement(m_element.get());
+}
+
+
+} // namespace WebKit
+
+#endif // ENABLE(FULLSCREEN_API)
diff --git a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.h
new file mode 100644 (file)
index 0000000..4edaffa
--- /dev/null
@@ -0,0 +1,78 @@
+/*
+ * Copyright (C) 2011 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+#ifndef WebFullScreenManager_h
+#define WebFullScreenManager_h
+
+#if ENABLE(FULLSCREEN_API)
+
+#include "Connection.h"
+#include <wtf/Forward.h>
+#include <wtf/Noncopyable.h>
+
+namespace CoreIPC {
+class ArgumentDecoder;
+class Connection;
+class MessageID;
+}
+
+namespace WebCore {
+class Element;
+}
+
+namespace WebKit {
+
+class WebPage;
+
+class WebFullScreenManager : public RefCounted<WebFullScreenManager> {
+public:
+    static PassRefPtr<WebFullScreenManager> create(WebPage*);
+
+    void didReceiveMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
+    bool supportsFullScreen();
+    void enterFullScreenForElement(WebCore::Element*);
+    void exitFullScreenForElement(WebCore::Element*);
+
+    WebCore::Element* element() { return m_element.get(); }
+
+private:
+    WebFullScreenManager(WebPage*);
+
+    void willEnterFullScreen();
+    void didEnterFullScreen();
+    void willExitFullScreen();
+    void didExitFullScreen();
+
+    void didReceiveWebFullScreenManagerMessage(CoreIPC::Connection*, CoreIPC::MessageID, CoreIPC::ArgumentDecoder*);
+
+    RefPtr<WebPage> m_page;
+    RefPtr<WebCore::Element> m_element;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(FULLSCREEN_API)
+
+#endif // WebFullScreenManager_h
diff --git a/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.messages.in b/Source/WebKit2/WebProcess/FullScreen/WebFullScreenManager.messages.in
new file mode 100644 (file)
index 0000000..f84081b
--- /dev/null
@@ -0,0 +1,30 @@
+# Copyright (C) 2011 Apple Inc. All rights reserved.
+#
+# Redistribution and use in source and binary forms, with or without
+# modification, are permitted provided that the following conditions
+# are met:
+# 1.  Redistributions of source code must retain the above copyright
+#     notice, this list of conditions and the following disclaimer.
+# 2.  Redistributions in binary form must reproduce the above copyright
+#     notice, this list of conditions and the following disclaimer in the
+#     documentation and/or other materials provided with the distribution.
+#
+# THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND
+# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+# DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR
+# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#if ENABLE(FULLSCREEN_API)
+messages -> WebFullScreenManager {
+    WillEnterFullScreen()
+    DidEnterFullScreen()
+    WillExitFullScreen()
+    DidExitFullScreen()
+}
+#endif
index b00d350..ac4d9fe 100644 (file)
@@ -34,6 +34,7 @@
 #include "WebCoreArgumentCoders.h"
 #include "WebFrame.h"
 #include "WebFrameLoaderClient.h"
+#include "WebFullScreenManager.h"
 #include "WebOpenPanelParameters.h"
 #include "WebOpenPanelResultListener.h"
 #include "WebPage.h"
@@ -704,6 +705,23 @@ void WebChromeClient::setLastSetCursorToCurrentCursor()
 }
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+bool WebChromeClient::supportsFullScreenForElement(const WebCore::Element* element)
+{
+    return m_page->fullScreenManager()->supportsFullScreen();
+}
+
+void WebChromeClient::enterFullScreenForElement(WebCore::Element* element)
+{
+    m_page->fullScreenManager()->enterFullScreenForElement(element);
+}
+
+void WebChromeClient::exitFullScreenForElement(WebCore::Element* element)
+{
+    m_page->fullScreenManager()->exitFullScreenForElement(element);
+}
+#endif
+
 void WebChromeClient::dispatchViewportDataDidChange(const ViewportArguments& args) const
 {
     m_page->send(Messages::WebPageProxy::DidChangeViewportData(args));
index 96da752..43d637c 100644 (file)
@@ -205,6 +205,12 @@ private:
     virtual void setLastSetCursorToCurrentCursor();
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+    virtual bool supportsFullScreenForElement(const WebCore::Element*);
+    virtual void enterFullScreenForElement(WebCore::Element*);
+    virtual void exitFullScreenForElement(WebCore::Element*);
+#endif
+
     virtual void dispatchViewportDataDidChange(const WebCore::ViewportArguments&) const;
 
     virtual void didCompleteRubberBandForMainFrame(const WebCore::IntSize&) const;
index 3ec0901..cc9b8cd 100644 (file)
@@ -54,6 +54,7 @@
 #include "WebEvent.h"
 #include "WebEventConversion.h"
 #include "WebFrame.h"
+#include "WebFullScreenManager.h"
 #include "WebGeolocationClient.h"
 #include "WebImage.h"
 #include "WebInspector.h"
@@ -352,6 +353,9 @@ void WebPage::close()
 #if ENABLE(INSPECTOR)
     m_inspector = 0;
 #endif
+#if ENABLE(FULLSCREEN_API)
+    m_fullScreenManager = 0;
+#endif
 
     if (m_activePopupMenu) {
         m_activePopupMenu->disconnectFromPage();
@@ -1400,6 +1404,15 @@ WebInspector* WebPage::inspector()
 }
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+WebFullScreenManager* WebPage::fullScreenManager()
+{
+    if (!m_fullScreenManager)
+        m_fullScreenManager = WebFullScreenManager::create(this);
+    return m_fullScreenManager.get();
+}
+#endif
+
 #if !PLATFORM(MAC)
 bool WebPage::handleEditingKeyboardEvent(KeyboardEvent* evt)
 {
@@ -1771,6 +1784,13 @@ void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::Messag
     }
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+    if (messageID.is<CoreIPC::MessageClassWebFullScreenManager>()) {
+        fullScreenManager()->didReceiveMessage(connection, messageID, arguments);
+        return;
+    }
+#endif
+
     didReceiveWebPageMessage(connection, messageID, arguments);
 }
 
index 270ec98..11497ed 100644 (file)
@@ -90,6 +90,7 @@ class WebContextMenu;
 class WebContextMenuItemData;
 class WebEvent;
 class WebFrame;
+class WebFullScreenManager;
 class WebImage;
 class WebInspector;
 class WebKeyboardEvent;
@@ -141,6 +142,10 @@ public:
     WebInspector* inspector();
 #endif
 
+#if ENABLE(FULLSCREEN_API)
+    WebFullScreenManager* fullScreenManager();
+#endif
+
     // -- Called by the DrawingArea.
     // FIXME: We could genericize these into a DrawingArea client interface. Would that be beneficial?
     void drawRect(WebCore::GraphicsContext&, const WebCore::IntRect&);
@@ -540,6 +545,9 @@ private:
 #if ENABLE(INSPECTOR)
     RefPtr<WebInspector> m_inspector;
 #endif
+#if ENABLE(FULLSCREEN_API)
+    RefPtr<WebFullScreenManager> m_fullScreenManager;
+#endif
     RefPtr<WebPopupMenu> m_activePopupMenu;
     RefPtr<WebContextMenu> m_contextMenu;
     RefPtr<WebOpenPanelResultListener> m_activeOpenPanelResultListener;
index dbfb366..1782bd4 100755 (executable)
                                >
                        </File>
                        <File
+                               RelativePath="..\UIProcess\WebFullScreenManagerProxy.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="..\UIProcess\WebFullScreenManagerProxy.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\UIProcess\WebGeolocationManagerProxy.cpp"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebFullScreenManagerMessageReceiver.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebFullScreenManagerMessages.h"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebFullScreenManagerProxyMessageReceiver.cpp"
+                               >
+                       </File>
+                       <File
+                               RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebFullScreenManagerProxyMessages.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources\WebGeolocationManagerMessageReceiver.cpp"
                                >
                        </File>
index e093639..eb68e00 100755 (executable)
@@ -6,7 +6,7 @@
        >
        <Tool
                Name="VCCLCompilerTool"
-               AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&quot;;&quot;$(ProjectDir)\..\WebProcess\ResourceCache&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
+               AdditionalIncludeDirectories="&quot;$(ProjectDir)&quot;;&quot;$(ProjectDir)\..&quot;;&quot;$(ProjectDir)\..\Platform&quot;;&quot;$(ProjectDir)\..\Platform\cg&quot;;&quot;$(ProjectDir)\..\Platform\CoreIPC&quot;;&quot;$(ProjectDir)\..\PluginProcess&quot;;&quot;$(ProjectDir)\..\Shared&quot;;&quot;$(ProjectDir)\..\Shared\win&quot;;&quot;$(ProjectDir)\..\Shared\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c&quot;;&quot;$(ProjectDir)\..\Shared\API\c\cf&quot;;&quot;$(ProjectDir)\..\Shared\API\c\win&quot;;&quot;$(ProjectDir)\..\Shared\CoreIPCSupport&quot;;&quot;$(ProjectDir)\..\Shared\Plugins&quot;;&quot;$(ProjectDir)\..\Shared\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\UIProcess&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C&quot;;&quot;$(ProjectDir)\..\UIProcess\API\C\win&quot;;&quot;$(ProjectDir)\..\UIProcess\API\cpp&quot;;&quot;$(ProjectDir)\..\UIProcess\API\win&quot;;&quot;$(ProjectDir)\..\UIProcess\Authentication&quot;;&quot;$(ProjectDir)\..\UIProcess\Downloads&quot;;&quot;$(ProjectDir)\..\UIProcess\Launcher&quot;;&quot;$(ProjectDir)\..\UIProcess\Plugins&quot;;&quot;$(ProjectDir)\..\UIProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport&quot;;&quot;$(ProjectDir)\..\WebProcess\WebCoreSupport\win&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage&quot;;&quot;$(ProjectDir)\..\WebProcess\WebPage\win&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\API\c&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\DOM&quot;;&quot;$(ProjectDir)\..\WebProcess\InjectedBundle\win&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins&quot;;&quot;$(ProjectDir)\..\WebProcess\Plugins\Netscape&quot;;&quot;$(ProjectDir)\..\WebProcess\win&quot;;&quot;$(ProjectDir)\..\WebProcess\ApplicationCache&quot;;&quot;$(ProjectDir)\..\WebProcess\Authentication&quot;;&quot;$(ProjectDir)\..\WebProcess\Cookies&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads&quot;;&quot;$(ProjectDir)\..\WebProcess\Downloads\cf&quot;;&quot;$(ProjectDir)\..\WebProcess\FullScreen&quot;;&quot;$(ProjectDir)\..\WebProcess\Geolocation&quot;;&quot;$(ProjectDir)\..\WebProcess\KeyValueStorage&quot;;&quot;$(ProjectDir)\..\WebProcess\ResourceCache&quot;;&quot;$(ConfigurationBuildDir)\obj\$(ProjectName)\DerivedSources&quot;;&quot;$(ConfigurationBuildDir)\Include&quot;;&quot;$(ConfigurationBuildDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include&quot;;&quot;$(WebKitLibrariesDir)\Include\private&quot;;&quot;$(WebKitLibrariesDir)\Include\pthreads&quot;;&quot;$(ConfigurationBuildDir)\Include\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\private\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\JavaScriptCore&quot;;&quot;$(WebKitLibrariesDir)\Include\private\JavaScriptCore&quot;;&quot;$(ConfigurationBuildDir)\Include\WebCore\ForwardingHeaders&quot;;&quot;$(WebKitLibrariesDir)\Include\WebCore\ForwardingHeaders&quot;"
                PreprocessorDefinitions="_USRDLL;WEBKIT_EXPORTS;FRAMEWORK_NAME=WebKit;BUILDING_WEBKIT"
                UsePrecompiledHeader="2"
                PrecompiledHeaderThrough="WebKit2Prefix.h"