Add WKPageRef SPI to tell whether there's a video playing in enhanced fullscreen
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 May 2016 21:53:43 +0000 (21:53 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 9 May 2016 21:53:43 +0000 (21:53 +0000)
https://bugs.webkit.org/show_bug.cgi?id=157434

Reviewed by Darin Adler.

* UIProcess/API/C/mac/WKPagePrivateMac.h:
* UIProcess/API/C/mac/WKPagePrivateMac.mm:
(WKPageIsPlayingVideoInEnhancedFullscreen):
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen):
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen):
* UIProcess/WebPageProxy.h:

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

Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.h
Source/WebKit2/UIProcess/API/C/mac/WKPagePrivateMac.mm
Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h
Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h

index 9103f7d..64bee4e 100644 (file)
@@ -1,3 +1,20 @@
+2016-05-06  Ada Chan  <adachan@apple.com>
+
+        Add WKPageRef SPI to tell whether there's a video playing in enhanced fullscreen
+        https://bugs.webkit.org/show_bug.cgi?id=157434
+
+        Reviewed by Darin Adler.
+
+        * UIProcess/API/C/mac/WKPagePrivateMac.h:
+        * UIProcess/API/C/mac/WKPagePrivateMac.mm:
+        (WKPageIsPlayingVideoInEnhancedFullscreen):
+        * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
+        * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
+        (WebKit::WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen):
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::isPlayingVideoInEnhancedFullscreen):
+        * UIProcess/WebPageProxy.h:
+
 2016-05-09  Anders Carlsson  <andersca@apple.com>
 
         Add injected bundle SPI for getting favicon and touch icon URLs
index ef68dd3..a6a5667 100644 (file)
@@ -59,6 +59,10 @@ WK_EXPORT _WKRemoteObjectRegistry *WKPageGetObjectRegistry(WKPageRef page);
 WK_EXPORT pid_t WKPageGetProcessIdentifier(WKPageRef page);
 WK_EXPORT bool WKPageIsURLKnownHSTSHost(WKPageRef page, WKURLRef url);
 
+#if TARGET_OS_MAC
+WK_EXPORT bool WKPageIsPlayingVideoInEnhancedFullscreen(WKPageRef page);
+#endif
+
 #ifdef __cplusplus
 }
 #endif
index 601d7e3..4f9d2e9 100644 (file)
@@ -128,3 +128,10 @@ bool WKPageIsURLKnownHSTSHost(WKPageRef page, WKURLRef url)
 
     return webPageProxy->process().processPool().isURLKnownHSTSHost(toImpl(url)->string(), privateBrowsingEnabled);
 }
+
+#if PLATFORM(MAC)
+bool WKPageIsPlayingVideoInEnhancedFullscreen(WKPageRef pageRef)
+{
+    return toImpl(pageRef)->isPlayingVideoInEnhancedFullscreen();
+}
+#endif
index 6d7e233..7f18379 100644 (file)
@@ -106,6 +106,10 @@ public:
     void applicationDidBecomeActive();
     bool isVisible() const;
 
+#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
+    bool isPlayingVideoInEnhancedFullscreen() const;
+#endif
+
 private:
     friend class WebVideoFullscreenModelContext;
 
index b14f135..fdf078a 100644 (file)
@@ -247,6 +247,17 @@ bool WebVideoFullscreenManagerProxy::mayAutomaticallyShowVideoPictureInPicture()
     return false;
 }
 
+#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
+bool WebVideoFullscreenManagerProxy::isPlayingVideoInEnhancedFullscreen() const
+{
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/WebVideoFullscreenManagerProxyIsPlayingVideoInEnhancedFullscreenAdditions.mm>
+#else
+    return false;
+#endif
+}
+#endif
+
 void WebVideoFullscreenManagerProxy::applicationDidBecomeActive()
 {
     for (auto& tuple : m_contextMap.values())
index 7fbc173..acc1c4e 100644 (file)
@@ -6068,6 +6068,15 @@ bool WebPageProxy::hasActiveVideoForControlsManager() const
     return false;
 #endif
 }
+
+bool WebPageProxy::isPlayingVideoInEnhancedFullscreen() const
+{
+#if ENABLE(VIDEO_PRESENTATION_MODE)
+    return m_videoFullscreenManager && m_videoFullscreenManager->isPlayingVideoInEnhancedFullscreen();
+#else
+    return false;
+#endif
+}
 #endif
 
 #if ENABLE(MEDIA_SESSION)
index 9ffacdd..6edee3e 100644 (file)
@@ -1026,6 +1026,7 @@ public:
 #if PLATFORM(MAC)
     void videoControlsManagerDidChange();
     bool hasActiveVideoForControlsManager() const;
+    bool isPlayingVideoInEnhancedFullscreen() const;
 #endif
 
 #if ENABLE(MEDIA_SESSION)