Title: [195755] trunk/Source
Revision
195755
Author
[email protected]
Date
2016-01-28 10:28:16 -0800 (Thu, 28 Jan 2016)

Log Message

Get WebVideoFullscreenManager and related classes to also compile for Mac platform
with video presentation mode support.
https://bugs.webkit.org/show_bug.cgi?id=153221

Reviewed by Eric Carlson.

Source/WebCore:

No new tests, no actual behavior change with a stub implementation of WebVideoFullscreenInterfaceMac.

* WebCore.xcodeproj/project.pbxproj:
Add PlatformView.h, WebVideoFullscreenChangeObserver.h, and WebVideoFullscreenInterfaceMac.h.

* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::HTMLMediaElement):
(WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
(WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction):
* html/HTMLMediaElement.h:
Enable the code that deals with the video fullscreen layer also for Mac platform with
video presentation mode support.

* platform/cocoa/PlatformView.h:
Header file for declaring the view types for each Cocoa platform.

* platform/cocoa/WebVideoFullscreenChangeObserver.h:
(WebCore::WebVideoFullscreenChangeObserver::~WebVideoFullscreenChangeObserver):
Interface declaration moved from WebVideoFullscreenInterfaceAVKit.h.

* platform/cocoa/WebVideoFullscreenInterface.h:
Stop guarding the declaration of WebVideoFullscreenInterface to be iOS specific. It is now
enabled for iOS and Mac platform with video presentation mode support.

* platform/cocoa/WebVideoFullscreenModel.h:
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
* platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
Enable also for Mac platform with video presentation mode support.
(WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
Set the video fullscreen layer's anchor point to (0, 0) since we are not changing the position of
the video layer on Mac.

* platform/ios/WebVideoFullscreenControllerAVKit.mm:
Import WebVideoFullscreenChangeObserver.h now that the interface declaration has been moved to that file.
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
Move the declaration of WebVideoFullscreenChangeObserver to a separate header.
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
Import WebVideoFullscreenChangeObserver.h now that the interface declaration has been moved to that file.

* platform/mac/WebVideoFullscreenInterfaceMac.h: Added.
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac):
(WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenModel):
(WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenChangeObserver):
(WebCore::WebVideoFullscreenInterfaceMac::resetMediaState):
(WebCore::WebVideoFullscreenInterfaceMac::setDuration):
(WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
(WebCore::WebVideoFullscreenInterfaceMac::setBufferedTime):
(WebCore::WebVideoFullscreenInterfaceMac::setRate):
(WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions):
(WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
(WebCore::WebVideoFullscreenInterfaceMac::setCanPlayFastReverse):
(WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions):
(WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions):
(WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback):
(WebCore::WebVideoFullscreenInterfaceMac::setWirelessVideoPlaybackDisabled):
(WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::invalidate):
(WebCore::WebVideoFullscreenInterfaceMac::requestHideAndExitFullscreen):
(WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline):
(WebCore::WebVideoFullscreenInterfaceMac::setMode):
(WebCore::WebVideoFullscreenInterfaceMac::clearMode):
(WebCore::WebVideoFullscreenInterfaceMac::mayAutomaticallyShowVideoPictureInPicture):
(WebCore::WebVideoFullscreenInterfaceMac::applicationDidBecomeActive):
(WebCore::supportsPictureInPicture):
Add a stub implementation of WebVideoFullscreenInterfaceMac.

Source/WebKit2:

* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
Enabled also for Mac with video presentation mode support.
(-[WKLayerHostView makeBackingLayer]):
Make sure this view uses CALayerHost for its layer.
(WebKit::WebVideoFullscreenManagerProxy::invalidate):
(WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
(WebKit::WebVideoFullscreenManagerProxy::ensureInterface):
(WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
Replace WebCore::WebVideoFullscreenInterfaceAVKit with PlatformWebVideoFullscreenInterface.
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
+[UIWindow _synchronizeDrawingAcrossProcesses] is not available on Mac.

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::viewDidLeaveWindow):
(WebKit::WebPageProxy::resetState):
* UIProcess/WebPageProxy.h:
The code that creates m_videoFullscreenManager is now enabled also on Mac with video
presentation mode support.

* WebProcess/WebCoreSupport/WebChromeClient.cpp:
* WebProcess/WebCoreSupport/WebChromeClient.h:
Enable the API related to the video fullscreen layer also on Mac with video presentation
mode support.

* WebProcess/WebPage/WebPage.cpp:
* WebProcess/WebPage/WebPage.h:
The code that creates m_videoFullscreenManager is now enabled also on Mac with video
presentation mode support.

* WebProcess/cocoa/WebVideoFullscreenManager.h:
* WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
Enabled also for Mac with video presentation mode support.
(WebKit::WebVideoFullscreenManager::supportsVideoFullscreen):
Return false for now on Mac.

Modified Paths

Added Paths

Diff

Modified: trunk/Source/WebCore/ChangeLog (195754 => 195755)


--- trunk/Source/WebCore/ChangeLog	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/ChangeLog	2016-01-28 18:28:16 UTC (rev 195755)
@@ -1,3 +1,81 @@
+2016-01-26  Ada Chan  <[email protected]>
+
+        Get WebVideoFullscreenManager and related classes to also compile for Mac platform
+        with video presentation mode support.
+        https://bugs.webkit.org/show_bug.cgi?id=153221
+
+        Reviewed by Eric Carlson.
+
+        No new tests, no actual behavior change with a stub implementation of WebVideoFullscreenInterfaceMac.
+
+        * WebCore.xcodeproj/project.pbxproj:
+        Add PlatformView.h, WebVideoFullscreenChangeObserver.h, and WebVideoFullscreenInterfaceMac.h.
+
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::HTMLMediaElement):
+        (WebCore::HTMLMediaElement::mediaPlayerEngineUpdated):
+        (WebCore::HTMLMediaElement::shouldOverrideBackgroundPlaybackRestriction):
+        * html/HTMLMediaElement.h:
+        Enable the code that deals with the video fullscreen layer also for Mac platform with
+        video presentation mode support.
+
+        * platform/cocoa/PlatformView.h:
+        Header file for declaring the view types for each Cocoa platform.
+
+        * platform/cocoa/WebVideoFullscreenChangeObserver.h:
+        (WebCore::WebVideoFullscreenChangeObserver::~WebVideoFullscreenChangeObserver):
+        Interface declaration moved from WebVideoFullscreenInterfaceAVKit.h.
+
+        * platform/cocoa/WebVideoFullscreenInterface.h:
+        Stop guarding the declaration of WebVideoFullscreenInterface to be iOS specific. It is now
+        enabled for iOS and Mac platform with video presentation mode support.
+
+        * platform/cocoa/WebVideoFullscreenModel.h:
+        * platform/cocoa/WebVideoFullscreenModelVideoElement.h:
+        * platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
+        Enable also for Mac platform with video presentation mode support.
+        (WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer):
+        Set the video fullscreen layer's anchor point to (0, 0) since we are not changing the position of
+        the video layer on Mac.
+
+        * platform/ios/WebVideoFullscreenControllerAVKit.mm:
+        Import WebVideoFullscreenChangeObserver.h now that the interface declaration has been moved to that file.
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.h:
+        Move the declaration of WebVideoFullscreenChangeObserver to a separate header.
+        * platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
+        Import WebVideoFullscreenChangeObserver.h now that the interface declaration has been moved to that file.
+
+        * platform/mac/WebVideoFullscreenInterfaceMac.h: Added.
+        * platform/mac/WebVideoFullscreenInterfaceMac.mm:
+        (WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac):
+        (WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenModel):
+        (WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenChangeObserver):
+        (WebCore::WebVideoFullscreenInterfaceMac::resetMediaState):
+        (WebCore::WebVideoFullscreenInterfaceMac::setDuration):
+        (WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
+        (WebCore::WebVideoFullscreenInterfaceMac::setBufferedTime):
+        (WebCore::WebVideoFullscreenInterfaceMac::setRate):
+        (WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions):
+        (WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
+        (WebCore::WebVideoFullscreenInterfaceMac::setCanPlayFastReverse):
+        (WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions):
+        (WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions):
+        (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback):
+        (WebCore::WebVideoFullscreenInterfaceMac::setWirelessVideoPlaybackDisabled):
+        (WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen):
+        (WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen):
+        (WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen):
+        (WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen):
+        (WebCore::WebVideoFullscreenInterfaceMac::invalidate):
+        (WebCore::WebVideoFullscreenInterfaceMac::requestHideAndExitFullscreen):
+        (WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline):
+        (WebCore::WebVideoFullscreenInterfaceMac::setMode):
+        (WebCore::WebVideoFullscreenInterfaceMac::clearMode):
+        (WebCore::WebVideoFullscreenInterfaceMac::mayAutomaticallyShowVideoPictureInPicture):
+        (WebCore::WebVideoFullscreenInterfaceMac::applicationDidBecomeActive):
+        (WebCore::supportsPictureInPicture):
+        Add a stub implementation of WebVideoFullscreenInterfaceMac.
+
 2016-01-28  Nikos Andronikos  <[email protected]>
 
         [SVG] Add support for 'lighter' operator in feComposite

Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (195754 => 195755)


--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj	2016-01-28 18:28:16 UTC (rev 195755)
@@ -2264,6 +2264,9 @@
 		52131E5B1C4F15760033F802 /* WebVideoFullscreenInterfaceMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 52131E5A1C4F15610033F802 /* WebVideoFullscreenInterfaceMac.mm */; };
 		521D46F611AEC98100514613 /* KillRingMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 521D46F511AEC98100514613 /* KillRingMac.mm */; };
 		521D46F811AEC9B100514613 /* KillRing.h in Headers */ = {isa = PBXBuildFile; fileRef = 521D46F711AEC9B100514613 /* KillRing.h */; };
+		52B0D4BE1C57FD1E0077CE53 /* PlatformView.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B0D4BD1C57FD1E0077CE53 /* PlatformView.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		52B0D4C01C57FD660077CE53 /* WebVideoFullscreenChangeObserver.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B0D4BF1C57FD660077CE53 /* WebVideoFullscreenChangeObserver.h */; settings = {ATTRIBUTES = (Private, ); }; };
+		52B0D4C21C57FF910077CE53 /* WebVideoFullscreenInterfaceMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B0D4C11C57FF910077CE53 /* WebVideoFullscreenInterfaceMac.h */; settings = {ATTRIBUTES = (Private, ); }; };
 		52B6C9C215E3F4DF00690B05 /* DOMNamedFlowCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B6C9BD15E3F4DF00690B05 /* DOMNamedFlowCollection.cpp */; };
 		52B6C9C315E3F4DF00690B05 /* DOMNamedFlowCollection.h in Headers */ = {isa = PBXBuildFile; fileRef = 52B6C9BE15E3F4DF00690B05 /* DOMNamedFlowCollection.h */; };
 		52B6C9C515E3F4DF00690B05 /* NamedFlowCollection.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 52B6C9C015E3F4DF00690B05 /* NamedFlowCollection.cpp */; };
@@ -9753,6 +9756,9 @@
 		52131E5A1C4F15610033F802 /* WebVideoFullscreenInterfaceMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebVideoFullscreenInterfaceMac.mm; sourceTree = "<group>"; };
 		521D46F511AEC98100514613 /* KillRingMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = KillRingMac.mm; sourceTree = "<group>"; };
 		521D46F711AEC9B100514613 /* KillRing.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = KillRing.h; sourceTree = "<group>"; };
+		52B0D4BD1C57FD1E0077CE53 /* PlatformView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PlatformView.h; sourceTree = "<group>"; };
+		52B0D4BF1C57FD660077CE53 /* WebVideoFullscreenChangeObserver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenChangeObserver.h; sourceTree = "<group>"; };
+		52B0D4C11C57FF910077CE53 /* WebVideoFullscreenInterfaceMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebVideoFullscreenInterfaceMac.h; sourceTree = "<group>"; };
 		52B6C9BD15E3F4DF00690B05 /* DOMNamedFlowCollection.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMNamedFlowCollection.cpp; sourceTree = "<group>"; };
 		52B6C9BE15E3F4DF00690B05 /* DOMNamedFlowCollection.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMNamedFlowCollection.h; sourceTree = "<group>"; };
 		52B6C9BF15E3F4DF00690B05 /* DOMNamedFlowCollection.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMNamedFlowCollection.idl; sourceTree = "<group>"; };
@@ -17719,6 +17725,7 @@
 				CD8203071395AB6A00F956C6 /* WebVideoFullscreenController.mm */,
 				CD8203081395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.h */,
 				CD8203091395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.mm */,
+				52B0D4C11C57FF910077CE53 /* WebVideoFullscreenInterfaceMac.h */,
 				52131E5A1C4F15610033F802 /* WebVideoFullscreenInterfaceMac.mm */,
 				CD82030E1395ACE700F956C6 /* WebWindowAnimation.h */,
 				CD82030F1395ACE700F956C6 /* WebWindowAnimation.mm */,
@@ -19823,6 +19830,7 @@
 				A19D93481AA11B1E00B46C24 /* NetworkExtensionContentFilter.mm */,
 				A18890AD1AA13F250026C301 /* ParentalControlsContentFilter.h */,
 				A18890AC1AA13F250026C301 /* ParentalControlsContentFilter.mm */,
+				52B0D4BD1C57FD1E0077CE53 /* PlatformView.h */,
 				1AA84F03143BA7BD0051D153 /* ScrollController.h */,
 				1AA84F02143BA7BD0051D153 /* ScrollController.mm */,
 				F478755219983AFF0024A287 /* ScrollSnapAnimatorState.h */,
@@ -19838,6 +19846,7 @@
 				CDC979F31C498C0900DB50D4 /* WebCoreNSErrorExtras.h */,
 				CDC979F21C498C0900DB50D4 /* WebCoreNSErrorExtras.mm */,
 				1A7E19441C5863BE00CCDDF3 /* WebKitAdditions.mm */,
+				52B0D4BF1C57FD660077CE53 /* WebVideoFullscreenChangeObserver.h */,
 				52131E581C4F15220033F802 /* WebVideoFullscreenInterface.h */,
 				52D5A1A41C57488900DE34A3 /* WebVideoFullscreenModel.h */,
 				52D5A1A51C57488900DE34A3 /* WebVideoFullscreenModelVideoElement.h */,
@@ -27150,6 +27159,7 @@
 				1AD8F81B11CAB9E900E93E54 /* PlatformStrategies.h in Headers */,
 				0F7D07331884C56C00B4AF86 /* PlatformTextTrack.h in Headers */,
 				074E82BB18A69F0E007EF54C /* PlatformTimeRanges.h in Headers */,
+				52B0D4BE1C57FD1E0077CE53 /* PlatformView.h in Headers */,
 				935C476B09AC4D4F00A6AAB4 /* PlatformWheelEvent.h in Headers */,
 				31D591B316697A6C00E6BF02 /* PlugInClient.h in Headers */,
 				A9C6E4F40D745E48006442E9 /* PluginData.h in Headers */,
@@ -28272,11 +28282,13 @@
 				97AABD2714FA09D5007457AE /* WebSocketHandshake.h in Headers */,
 				31DEA4561B39F4D900F77178 /* WebSystemBackdropLayer.h in Headers */,
 				0F580FA31496939100FB5BD8 /* WebTiledBackingLayer.h in Headers */,
+				52B0D4C01C57FD660077CE53 /* WebVideoFullscreenChangeObserver.h in Headers */,
 				CD82030A1395AB6A00F956C6 /* WebVideoFullscreenController.h in Headers */,
 				3F42B31D1881191B00278AAC /* WebVideoFullscreenControllerAVKit.h in Headers */,
 				CD82030C1395AB6A00F956C6 /* WebVideoFullscreenHUDWindowController.h in Headers */,
 				52131E591C4F15350033F802 /* WebVideoFullscreenInterface.h in Headers */,
 				3FBC4AF4189881560046EE38 /* WebVideoFullscreenInterfaceAVKit.h in Headers */,
+				52B0D4C21C57FF910077CE53 /* WebVideoFullscreenInterfaceMac.h in Headers */,
 				52D5A1A71C57489D00DE34A3 /* WebVideoFullscreenModel.h in Headers */,
 				52D5A1A81C5748A300DE34A3 /* WebVideoFullscreenModelVideoElement.h in Headers */,
 				F12171F616A8CF0B000053CA /* WebVTTElement.h in Headers */,

Modified: trunk/Source/WebCore/html/HTMLMediaElement.cpp (195754 => 195755)


--- trunk/Source/WebCore/html/HTMLMediaElement.cpp	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/html/HTMLMediaElement.cpp	2016-01-28 18:28:16 UTC (rev 195755)
@@ -108,6 +108,10 @@
 #include "MediaElementAudioSourceNode.h"
 #endif
 
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
+#include "WebVideoFullscreenInterface.h"
+#endif
+
 #if PLATFORM(IOS)
 #include "RuntimeApplicationChecksIOS.h"
 #include "WebVideoFullscreenInterfaceAVKit.h"
@@ -336,7 +340,7 @@
     , m_lastTimeUpdateEventMovieTime(MediaTime::positiveInfiniteTime())
     , m_loadState(WaitingForSource)
     , m_videoFullscreenMode(VideoFullscreenModeNone)
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     , m_videoFullscreenGravity(MediaPlayer::VideoGravityResizeAspect)
 #endif
     , m_preload(MediaPlayer::Auto)
@@ -4546,7 +4550,7 @@
     }
 #endif
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     if (!m_player)
         return;
     m_player->setVideoFullscreenFrame(m_videoFullscreenFrame);
@@ -5364,7 +5368,7 @@
     return m_player ? m_player->platformLayer() : nullptr;
 }
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 void HTMLMediaElement::setVideoFullscreenLayer(PlatformLayer* platformLayer)
 {
     m_videoFullscreenLayer = platformLayer;
@@ -6556,7 +6560,7 @@
 #endif
     if (m_videoFullscreenMode & VideoFullscreenModePictureInPicture)
         return true;
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     if (m_videoFullscreenMode == VideoFullscreenModeStandard && supportsPictureInPicture() && isPlaying())
         return true;
 #endif

Modified: trunk/Source/WebCore/html/HTMLMediaElement.h (195754 => 195755)


--- trunk/Source/WebCore/html/HTMLMediaElement.h	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/html/HTMLMediaElement.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -130,7 +130,7 @@
 
     WEBCORE_EXPORT PlatformMedia platformMedia() const;
     PlatformLayer* platformLayer() const;
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     void setVideoFullscreenLayer(PlatformLayer*);
     PlatformLayer* videoFullscreenLayer() const { return m_videoFullscreenLayer.get(); }
     void setVideoFullscreenFrame(FloatRect);
@@ -821,7 +821,7 @@
     RefPtr<Node> m_nextChildNodeToConsider;
 
     VideoFullscreenMode m_videoFullscreenMode;
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     RetainPtr<PlatformLayer> m_videoFullscreenLayer;
     FloatRect m_videoFullscreenFrame;
     MediaPlayerEnums::VideoGravity m_videoFullscreenGravity;

Copied: trunk/Source/WebCore/platform/cocoa/PlatformView.h (from rev 195752, trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm) (0 => 195755)


--- trunk/Source/WebCore/platform/cocoa/PlatformView.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/cocoa/PlatformView.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2016 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. ``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
+ * 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 PlatformView_h
+#define PlatformView_h
+
+#if PLATFORM(COCOA)
+
+#if PLATFORM(IOS)
+OBJC_CLASS UIView;
+typedef UIView PlatformView;
+#else
+OBJC_CLASS NSView;
+typedef NSView PlatformView;
+#endif
+
+#endif
+
+#endif /* PlatformView_h */

Copied: trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h (from rev 195752, trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm) (0 => 195755)


--- trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -0,0 +1,48 @@
+/*
+ * Copyright (C) 2016 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. ``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
+ * 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 WebVideoFullscreenChangeObserver_h
+#define WebVideoFullscreenChangeObserver_h
+
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
+
+namespace WebCore {
+
+class WebVideoFullscreenChangeObserver {
+public:
+    virtual ~WebVideoFullscreenChangeObserver() { };
+    virtual void didSetupFullscreen() = 0;
+    virtual void didEnterFullscreen() = 0;
+    virtual void didExitFullscreen() = 0;
+    virtual void didCleanupFullscreen() = 0;
+    virtual void fullscreenMayReturnToInline() = 0;
+};
+
+}
+
+#endif
+
+#endif

Modified: trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h (195754 => 195755)


--- trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -38,7 +38,6 @@
 
 bool supportsPictureInPicture();
 
-#if PLATFORM(IOS)
 class TimeRanges;
 
 class WebVideoFullscreenInterface {
@@ -59,7 +58,6 @@
     virtual void setExternalPlayback(bool enabled, ExternalPlaybackTargetType, WTF::String localizedDeviceName) = 0;
     virtual void setWirelessVideoPlaybackDisabled(bool) = 0;
 };
-#endif
 
 }
 

Modified: trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h (195754 => 195755)


--- trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -27,9 +27,10 @@
 #ifndef WebVideoFullscreenModel_h
 #define WebVideoFullscreenModel_h
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 
 #include <WebCore/FloatRect.h>
+#include <WebCore/HTMLMediaElementEnums.h>
 
 namespace WebCore {
 

Modified: trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h (195754 => 195755)


--- trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -27,7 +27,7 @@
 #ifndef WebVideoFullscreenModelVideoElement_h
 #define WebVideoFullscreenModelVideoElement_h
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 
 #include <WebCore/EventListener.h>
 #include <WebCore/FloatRect.h>

Modified: trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm (195754 => 195755)


--- trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm	2016-01-28 18:28:16 UTC (rev 195755)
@@ -25,7 +25,7 @@
 
 #import "config.h"
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 #import "WebVideoFullscreenModelVideoElement.h"
 
 #import "DOMEventInternal.h"
@@ -44,7 +44,6 @@
 #import <WebCore/SoftLinking.h>
 #import <WebCore/TextTrackList.h>
 #import <WebCore/TimeRanges.h>
-#import <WebCore/WebCoreThreadRun.h>
 #import <wtf/NeverDestroyed.h>
 #import <wtf/RetainPtr.h>
 
@@ -177,7 +176,11 @@
         return;
     
     m_videoFullscreenLayer = videoLayer;
+#if PLATFORM(MAC)
+    [m_videoFullscreenLayer setAnchorPoint:CGPointMake(0, 0)];
+#else
     [m_videoFullscreenLayer setAnchorPoint:CGPointMake(0.5, 0.5)];
+#endif
     [m_videoFullscreenLayer setBounds:m_videoFrame];
     
     if (m_videoElement)

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm (195754 => 195755)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm	2016-01-28 18:28:16 UTC (rev 195755)
@@ -33,6 +33,7 @@
 #import "QuartzCoreSPI.h"
 #import "SoftLinking.h"
 #import "TimeRanges.h"
+#import "WebVideoFullscreenChangeObserver.h"
 #import "WebVideoFullscreenInterfaceAVKit.h"
 #import "WebVideoFullscreenModelVideoElement.h"
 #import <QuartzCore/CoreAnimation.h>

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h (195754 => 195755)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -56,17 +56,8 @@
 namespace WebCore {
 class IntRect;
 class WebVideoFullscreenModel;
+class WebVideoFullscreenChangeObserver;
     
-class WebVideoFullscreenChangeObserver {
-public:
-    virtual ~WebVideoFullscreenChangeObserver() { };
-    virtual void didSetupFullscreen() = 0;
-    virtual void didEnterFullscreen() = 0;
-    virtual void didExitFullscreen() = 0;
-    virtual void didCleanupFullscreen() = 0;
-    virtual void fullscreenMayReturnToInline() = 0;
-};
-
 class WEBCORE_EXPORT WebVideoFullscreenInterfaceAVKit
     : public WebVideoFullscreenInterface
     , public RefCounted<WebVideoFullscreenInterfaceAVKit> {

Modified: trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm (195754 => 195755)


--- trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm	2016-01-28 18:28:16 UTC (rev 195755)
@@ -38,6 +38,7 @@
 #import "RuntimeApplicationChecksIOS.h"
 #import "TimeRanges.h"
 #import "WebCoreSystemInterface.h"
+#import "WebVideoFullscreenChangeObserver.h"
 #import "WebVideoFullscreenModel.h"
 #import <AVFoundation/AVTime.h>
 #import <UIKit/UIKit.h>

Added: trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h (0 => 195755)


--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h	                        (rev 0)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -0,0 +1,95 @@
+/*
+ * Copyright (C) 2016 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. ``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
+ * 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 WebVideoFullscreenInterfaceMac_h
+#define WebVideoFullscreenInterfaceMac_h
+
+#if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
+
+#include <WebCore/HTMLMediaElementEnums.h>
+#include <WebCore/WebVideoFullscreenInterface.h>
+#include <wtf/RefCounted.h>
+#include <wtf/RetainPtr.h>
+#include <wtf/text/WTFString.h>
+
+namespace WebCore {
+class IntRect;
+class WebVideoFullscreenChangeObserver;
+class WebVideoFullscreenModel;
+
+class WEBCORE_EXPORT WebVideoFullscreenInterfaceMac
+    : public WebVideoFullscreenInterface
+    , public RefCounted<WebVideoFullscreenInterfaceMac> {
+
+public:
+    static Ref<WebVideoFullscreenInterfaceMac> create()
+    {
+        return adoptRef(*new WebVideoFullscreenInterfaceMac());
+    }
+    virtual ~WebVideoFullscreenInterfaceMac();
+    WEBCORE_EXPORT void setWebVideoFullscreenModel(WebVideoFullscreenModel*);
+    WEBCORE_EXPORT void setWebVideoFullscreenChangeObserver(WebVideoFullscreenChangeObserver*);
+
+    WEBCORE_EXPORT void resetMediaState() override { }
+    WEBCORE_EXPORT void setDuration(double) override { }
+    WEBCORE_EXPORT void setCurrentTime(double /*currentTime*/, double /*anchorTime*/) override { }
+    WEBCORE_EXPORT void setBufferedTime(double) override { }
+    WEBCORE_EXPORT void setRate(bool /*isPlaying*/, float /*playbackRate*/) override { }
+    WEBCORE_EXPORT void setVideoDimensions(bool /*hasVideo*/, float /*width*/, float /*height*/) override { }
+    WEBCORE_EXPORT void setSeekableRanges(const TimeRanges&) override { }
+    WEBCORE_EXPORT void setCanPlayFastReverse(bool) override { }
+    WEBCORE_EXPORT void setAudioMediaSelectionOptions(const Vector<WTF::String>& /*options*/, uint64_t /*selectedIndex*/) override { }
+    WEBCORE_EXPORT void setLegibleMediaSelectionOptions(const Vector<WTF::String>& /*options*/, uint64_t /*selectedIndex*/) override { }
+    WEBCORE_EXPORT void setExternalPlayback(bool /*enabled*/, ExternalPlaybackTargetType, WTF::String /*localizedDeviceName*/) override { }
+    WEBCORE_EXPORT void setWirelessVideoPlaybackDisabled(bool) override { }
+
+    WEBCORE_EXPORT void setupFullscreen(NSView& /*layerHostedView*/, const IntRect& /*initialRect*/, HTMLMediaElementEnums::VideoFullscreenMode, bool /*allowsPictureInPicturePlayback*/) { }
+    WEBCORE_EXPORT void enterFullscreen() { }
+    WEBCORE_EXPORT void exitFullscreen(const IntRect& /*finalRect*/) { }
+    WEBCORE_EXPORT void cleanupFullscreen() { }
+    WEBCORE_EXPORT void invalidate() { }
+    WEBCORE_EXPORT void requestHideAndExitFullscreen() { }
+    WEBCORE_EXPORT void preparedToReturnToInline(bool /*visible*/, const IntRect& /*inlineRect*/) { }
+
+    HTMLMediaElementEnums::VideoFullscreenMode mode() const { return m_mode; }
+    bool hasMode(HTMLMediaElementEnums::VideoFullscreenMode mode) const { return m_mode & mode; }
+    bool isMode(HTMLMediaElementEnums::VideoFullscreenMode mode) const { return m_mode == mode; }
+    void setMode(HTMLMediaElementEnums::VideoFullscreenMode);
+    void clearMode(HTMLMediaElementEnums::VideoFullscreenMode);
+
+    WEBCORE_EXPORT bool mayAutomaticallyShowVideoPictureInPicture() const { return false; }
+    void applicationDidBecomeActive() { }
+
+protected:
+    WebVideoFullscreenModel* m_videoFullscreenModel { nullptr };
+    WebVideoFullscreenChangeObserver* m_fullscreenChangeObserver { nullptr };
+    HTMLMediaElementEnums::VideoFullscreenMode m_mode { HTMLMediaElementEnums::VideoFullscreenModeNone };
+};
+
+}
+
+#endif
+
+#endif /* WebVideoFullscreenInterfaceMac_h */

Modified: trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm (195754 => 195755)


--- trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm	2016-01-28 18:28:16 UTC (rev 195755)
@@ -24,13 +24,57 @@
  */
 
 #import "config.h"
-#import "WebVideoFullscreenInterface.h"
+#import "WebVideoFullscreenInterfaceMac.h"
 
 #if PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE)
 
-bool WebCore::supportsPictureInPicture()
+#import "IntRect.h"
+#import "WebVideoFullscreenChangeObserver.h"
+#import "WebVideoFullscreenModel.h"
+
+namespace WebCore {
+
+WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac()
 {
+}
+
+void WebVideoFullscreenInterfaceMac::setWebVideoFullscreenModel(WebVideoFullscreenModel* model)
+{
+    m_videoFullscreenModel = model;
+}
+
+void WebVideoFullscreenInterfaceMac::setWebVideoFullscreenChangeObserver(WebVideoFullscreenChangeObserver* observer)
+{
+    m_fullscreenChangeObserver = observer;
+}
+
+void WebVideoFullscreenInterfaceMac::setMode(HTMLMediaElementEnums::VideoFullscreenMode mode)
+{
+    HTMLMediaElementEnums::VideoFullscreenMode newMode = m_mode | mode;
+    if (m_mode == newMode)
+        return;
+
+    m_mode = newMode;
+    if (m_videoFullscreenModel)
+        m_videoFullscreenModel->fullscreenModeChanged(m_mode);
+}
+
+void WebVideoFullscreenInterfaceMac::clearMode(HTMLMediaElementEnums::VideoFullscreenMode mode)
+{
+    HTMLMediaElementEnums::VideoFullscreenMode newMode = m_mode & ~mode;
+    if (m_mode == newMode)
+        return;
+
+    m_mode = newMode;
+    if (m_videoFullscreenModel)
+        m_videoFullscreenModel->fullscreenModeChanged(m_mode);
+}
+
+bool supportsPictureInPicture()
+{
     return false;
 }
 
+}
+
 #endif

Modified: trunk/Source/WebKit2/ChangeLog (195754 => 195755)


--- trunk/Source/WebKit2/ChangeLog	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/ChangeLog	2016-01-28 18:28:16 UTC (rev 195755)
@@ -1,3 +1,51 @@
+2016-01-26  Ada Chan  <[email protected]>
+
+        Get WebVideoFullscreenManager and related classes to also compile for Mac platform
+        with video presentation mode support.
+        https://bugs.webkit.org/show_bug.cgi?id=153221
+
+        Reviewed by Eric Carlson.
+
+        * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
+        * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
+        * UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
+        Enabled also for Mac with video presentation mode support.
+        (-[WKLayerHostView makeBackingLayer]):
+        Make sure this view uses CALayerHost for its layer.
+        (WebKit::WebVideoFullscreenManagerProxy::invalidate):
+        (WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
+        (WebKit::WebVideoFullscreenManagerProxy::ensureInterface):
+        (WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID):
+        Replace WebCore::WebVideoFullscreenInterfaceAVKit with PlatformWebVideoFullscreenInterface.
+        (WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame):
+        +[UIWindow _synchronizeDrawingAcrossProcesses] is not available on Mac.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::WebPageProxy):
+        (WebKit::WebPageProxy::reattachToWebProcess):
+        (WebKit::WebPageProxy::viewDidLeaveWindow):
+        (WebKit::WebPageProxy::resetState):
+        * UIProcess/WebPageProxy.h:
+        The code that creates m_videoFullscreenManager is now enabled also on Mac with video
+        presentation mode support.
+
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        Enable the API related to the video fullscreen layer also on Mac with video presentation
+        mode support.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        * WebProcess/WebPage/WebPage.h:
+        The code that creates m_videoFullscreenManager is now enabled also on Mac with video
+        presentation mode support.
+
+        * WebProcess/cocoa/WebVideoFullscreenManager.h:
+        * WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
+        * WebProcess/cocoa/WebVideoFullscreenManager.mm:
+        Enabled also for Mac with video presentation mode support.
+        (WebKit::WebVideoFullscreenManager::supportsVideoFullscreen):
+        Return false for now on Mac.
+
 2016-01-28  Darin Adler  <[email protected]>
 
         Remove equalIgnoringCase since all callers really wanted equalIgnoringASCIICase

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h (195754 => 195755)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -26,19 +26,30 @@
 #ifndef WebVideoFullscreenManagerProxy_h
 #define WebVideoFullscreenManagerProxy_h
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 
 #include "MessageReceiver.h"
 #include <WebCore/GraphicsLayer.h>
-#include <WebCore/WebVideoFullscreenInterfaceAVKit.h>
+#include <WebCore/PlatformView.h>
+#include <WebCore/WebVideoFullscreenChangeObserver.h>
 #include <WebCore/WebVideoFullscreenModel.h>
 #include <wtf/HashMap.h>
 #include <wtf/PassRefPtr.h>
 #include <wtf/RefCounted.h>
 #include <wtf/RefPtr.h>
 
-OBJC_CLASS UIView;
+#if PLATFORM(IOS)
+#include <WebCore/WebVideoFullscreenInterfaceAVKit.h>
+#else
+#include <WebCore/WebVideoFullscreenInterfaceMac.h>
+#endif
 
+#if PLATFORM(IOS)
+typedef WebCore::WebVideoFullscreenInterfaceAVKit PlatformWebVideoFullscreenInterface;
+#else
+typedef WebCore::WebVideoFullscreenInterfaceMac PlatformWebVideoFullscreenInterface;
+#endif
+
 namespace WebKit {
 
 class WebPageProxy;
@@ -54,8 +65,8 @@
 
     void invalidate() { m_manager = nullptr; }
 
-    UIView *layerHostView() const { return m_layerHostView.get(); }
-    void setLayerHostView(RetainPtr<UIView>&& layerHostView) { m_layerHostView = WTFMove(layerHostView); }
+    PlatformView *layerHostView() const { return m_layerHostView.get(); }
+    void setLayerHostView(RetainPtr<PlatformView>&& layerHostView) { m_layerHostView = WTFMove(layerHostView); }
 
 private:
     WebVideoFullscreenModelContext(WebVideoFullscreenManagerProxy& manager, uint64_t contextId)
@@ -92,7 +103,7 @@
 
     WebVideoFullscreenManagerProxy* m_manager;
     uint64_t m_contextId;
-    RetainPtr<UIView *> m_layerHostView;
+    RetainPtr<PlatformView *> m_layerHostView;
 };
 
 class WebVideoFullscreenManagerProxy : public RefCounted<WebVideoFullscreenManagerProxy>, private IPC::MessageReceiver {
@@ -114,11 +125,11 @@
     explicit WebVideoFullscreenManagerProxy(WebPageProxy&);
     virtual void didReceiveMessage(IPC::Connection&, IPC::MessageDecoder&) override;
 
-    typedef std::tuple<RefPtr<WebVideoFullscreenModelContext>, RefPtr<WebCore::WebVideoFullscreenInterfaceAVKit>> ModelInterfaceTuple;
+    typedef std::tuple<RefPtr<WebVideoFullscreenModelContext>, RefPtr<PlatformWebVideoFullscreenInterface>> ModelInterfaceTuple;
     ModelInterfaceTuple createModelAndInterface(uint64_t contextId);
     ModelInterfaceTuple& ensureModelAndInterface(uint64_t contextId);
     WebVideoFullscreenModelContext& ensureModel(uint64_t contextId);
-    WebCore::WebVideoFullscreenInterfaceAVKit& ensureInterface(uint64_t contextId);
+    PlatformWebVideoFullscreenInterface& ensureInterface(uint64_t contextId);
 
     // Messages from WebVideoFullscreenManager
     void setupFullscreenWithID(uint64_t contextId, uint32_t videoLayerID, const WebCore::IntRect& initialRect, float hostingScaleFactor, WebCore::HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicture);
@@ -169,6 +180,6 @@
     
 } // namespace WebKit
 
-#endif // PLATFORM(IOS)
+#endif // PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 
 #endif // WebVideoFullscreenManagerProxy_h

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in (195754 => 195755)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in	2016-01-28 18:28:16 UTC (rev 195755)
@@ -20,7 +20,7 @@
 # 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 PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 messages -> WebVideoFullscreenManagerProxy {
     ResetMediaState(uint64_t contextId)
     SetCurrentTime(uint64_t contextId, double currentTime, double hostTime)

Modified: trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm (195754 => 195755)


--- trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm	2016-01-28 18:28:16 UTC (rev 195755)
@@ -26,10 +26,8 @@
 #import "config.h"
 #import "WebVideoFullscreenManagerProxy.h"
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 
-#import "RemoteLayerTreeDrawingAreaProxy.h"
-#import "UIKitSPI.h"
 #import "WebPageProxy.h"
 #import "WebProcessProxy.h"
 #import "WebVideoFullscreenManagerMessages.h"
@@ -39,15 +37,27 @@
 #import <WebCore/TimeRanges.h>
 #import <WebKitSystemInterface.h>
 
-@interface WKLayerHostView : UIView
+#if PLATFORM(IOS)
+#import "RemoteLayerTreeDrawingAreaProxy.h"
+#import "UIKitSPI.h"
+#endif
+
+@interface WKLayerHostView : PlatformView
 @property (nonatomic, assign) uint32_t contextID;
 @end
 
 @implementation WKLayerHostView
 
+#if PLATFORM(IOS)
 + (Class)layerClass {
     return [CALayerHost class];
 }
+#else
+- (CALayer *)makeBackingLayer
+{
+    return [[CALayerHost alloc] init];
+}
+#endif
 
 - (uint32_t)contextID {
     return [[self layerHost] contextId];
@@ -67,7 +77,7 @@
 
 namespace WebKit {
 
-#if !HAVE(AVKIT)
+#if PLATFORM(IOS) && !HAVE(AVKIT)
 
 RefPtr<WebVideoFullscreenManagerProxy> WebVideoFullscreenManagerProxy::create(WebPageProxy&)
 {
@@ -259,7 +269,7 @@
 
     for (auto& tuple : m_contextMap.values()) {
         RefPtr<WebVideoFullscreenModelContext> model;
-        RefPtr<WebCore::WebVideoFullscreenInterfaceAVKit> interface;
+        RefPtr<PlatformWebVideoFullscreenInterface> interface;
         std::tie(model, interface) = tuple;
 
         interface->invalidate();
@@ -303,7 +313,7 @@
 WebVideoFullscreenManagerProxy::ModelInterfaceTuple WebVideoFullscreenManagerProxy::createModelAndInterface(uint64_t contextId)
 {
     Ref<WebVideoFullscreenModelContext> model = WebVideoFullscreenModelContext::create(*this, contextId);
-    Ref<WebCore::WebVideoFullscreenInterfaceAVKit> interface = WebVideoFullscreenInterfaceAVKit::create();
+    Ref<PlatformWebVideoFullscreenInterface> interface = PlatformWebVideoFullscreenInterface::create();
 
     interface->setWebVideoFullscreenModel(&model.get());
     interface->setWebVideoFullscreenChangeObserver(&model.get());
@@ -324,7 +334,7 @@
     return *std::get<0>(ensureModelAndInterface(contextId));
 }
 
-WebCore::WebVideoFullscreenInterfaceAVKit& WebVideoFullscreenManagerProxy::ensureInterface(uint64_t contextId)
+PlatformWebVideoFullscreenInterface& WebVideoFullscreenManagerProxy::ensureInterface(uint64_t contextId)
 {
     return *std::get<1>(ensureModelAndInterface(contextId));
 }
@@ -335,13 +345,16 @@
 {
     ASSERT(videoLayerID);
     RefPtr<WebVideoFullscreenModelContext> model;
-    RefPtr<WebCore::WebVideoFullscreenInterfaceAVKit> interface;
+    RefPtr<PlatformWebVideoFullscreenInterface> interface;
 
     std::tie(model, interface) = ensureModelAndInterface(contextId);
 
     RetainPtr<WKLayerHostView> view = static_cast<WKLayerHostView*>(model->layerHostView());
     if (!view) {
         view = adoptNS([[WKLayerHostView alloc] init]);
+#if PLATFORM(MAC)
+        [view setWantsLayer:YES];
+#endif
         model->setLayerHostView(view);
     }
     [view setContextID:videoLayerID];
@@ -351,8 +364,12 @@
         [[view layer] setSublayerTransform:CATransform3DMakeScale(inverseScale, inverseScale, 1)];
     }
 
+#if PLATFORM(IOS)
     UIView *parentView = downcast<RemoteLayerTreeDrawingAreaProxy>(*m_page->drawingArea()).remoteLayerTreeHost().rootLayer();
     interface->setupFullscreen(*model->layerHostView(), initialRect, parentView, videoFullscreenMode, allowsPictureInPicture);
+#else
+    interface->setupFullscreen(*model->layerHostView(), initialRect, videoFullscreenMode, allowsPictureInPicture);
+#endif
 }
 
 void WebVideoFullscreenManagerProxy::resetMediaState(uint64_t contextId)
@@ -549,7 +566,11 @@
 void WebVideoFullscreenManagerProxy::setVideoLayerFrame(uint64_t contextId, WebCore::FloatRect frame)
 {
     @autoreleasepool {
+#if PLATFORM(IOS)
         mach_port_name_t fencePort = [UIWindow _synchronizeDrawingAcrossProcesses];
+#else
+        mach_port_name_t fencePort = 0;
+#endif
 
         m_page->send(Messages::WebVideoFullscreenManager::SetVideoLayerFrameFenced(contextId, frame, IPC::Attachment(fencePort, MACH_MSG_TYPE_MOVE_SEND)), m_page->pageID());
     }
@@ -590,4 +611,4 @@
 
 } // namespace WebKit
 
-#endif // PLATFORM(IOS)
+#endif // PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (195754 => 195755)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp	2016-01-28 18:28:16 UTC (rev 195755)
@@ -143,16 +143,13 @@
 #include "RemoteLayerTreeDrawingAreaProxy.h"
 #include "RemoteLayerTreeScrollingPerformanceData.h"
 #include "ViewSnapshotStore.h"
+#include "WebVideoFullscreenManagerProxy.h"
+#include "WebVideoFullscreenManagerProxyMessages.h"
 #include <WebCore/MachSendRight.h>
 #include <WebCore/RunLoopObserver.h>
 #include <WebCore/TextIndicatorWindow.h>
 #endif
 
-#if PLATFORM(IOS)
-#include "WebVideoFullscreenManagerProxy.h"
-#include "WebVideoFullscreenManagerProxyMessages.h"
-#endif
-
 #if USE(CAIRO)
 #include <WebCore/CairoUtilities.h>
 #endif
@@ -470,7 +467,7 @@
 #if ENABLE(FULLSCREEN_API)
     m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_pageClient.fullScreenManagerProxyClient());
 #endif
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     m_videoFullscreenManager = WebVideoFullscreenManagerProxy::create(*this);
 #endif
 #if ENABLE(VIBRATION)
@@ -705,7 +702,7 @@
 #if ENABLE(FULLSCREEN_API)
     m_fullScreenManager = WebFullScreenManagerProxy::create(*this, m_pageClient.fullScreenManagerProxyClient());
 #endif
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     m_videoFullscreenManager = WebVideoFullscreenManagerProxy::create(*this);
 #endif
 
@@ -1398,7 +1395,7 @@
     if (m_colorPicker)
         endColorPicker();
 #endif
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     // When leaving the current page, close the video fullscreen.
     if (m_videoFullscreenManager)
         m_videoFullscreenManager->requestHideAndExitFullscreen();
@@ -3977,12 +3974,14 @@
 }
 #endif
     
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 RefPtr<WebVideoFullscreenManagerProxy> WebPageProxy::videoFullscreenManager()
 {
     return m_videoFullscreenManager;
 }
+#endif
 
+#if PLATFORM(IOS)
 bool WebPageProxy::allowsMediaDocumentInlinePlayback() const
 {
     return m_allowsMediaDocumentInlinePlayback;
@@ -5026,12 +5025,14 @@
 
     m_visibleScrollerThumbRect = IntRect();
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     if (m_videoFullscreenManager) {
         m_videoFullscreenManager->invalidate();
         m_videoFullscreenManager = nullptr;
     }
+#endif
 
+#if PLATFORM(IOS)
     m_lastVisibleContentRectUpdate = VisibleContentRectUpdateInfo();
     m_dynamicViewportSizeUpdateWaitingForTarget = false;
     m_dynamicViewportSizeUpdateWaitingForLayerTreeCommit = false;

Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (195754 => 195755)


--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -329,9 +329,11 @@
 #if ENABLE(FULLSCREEN_API)
     WebFullScreenManagerProxy* fullScreenManager();
 #endif
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     RefPtr<WebVideoFullscreenManagerProxy> videoFullscreenManager();
+#endif
 
+#if PLATFORM(IOS)
     bool allowsMediaDocumentInlinePlayback() const;
     void setAllowsMediaDocumentInlinePlayback(bool);
 #endif
@@ -1535,8 +1537,10 @@
 #if ENABLE(FULLSCREEN_API)
     RefPtr<WebFullScreenManagerProxy> m_fullScreenManager;
 #endif
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
+    RefPtr<WebVideoFullscreenManagerProxy> m_videoFullscreenManager;
+#endif
 #if PLATFORM(IOS)
-    RefPtr<WebVideoFullscreenManagerProxy> m_videoFullscreenManager;
     VisibleContentRectUpdateInfo m_lastVisibleContentRectUpdate;
     bool m_hasReceivedLayerTreeTransactionAfterDidCommitLoad;
     uint64_t m_firstLayerTreeTransactionIdAfterDidCommitLoad;

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (195754 => 195755)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp	2016-01-28 18:28:16 UTC (rev 195755)
@@ -75,7 +75,7 @@
 #include <WebCore/SecurityOriginData.h>
 #include <WebCore/Settings.h>
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 #include "WebVideoFullscreenManager.h"
 #endif
 
@@ -849,7 +849,7 @@
 }
 #endif
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 bool WebChromeClient::supportsVideoFullscreen(WebCore::HTMLMediaElementEnums::VideoFullscreenMode)
 {
     return m_page->videoFullscreenManager()->supportsVideoFullscreen();

Modified: trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (195754 => 195755)


--- trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -242,7 +242,7 @@
     virtual void elementDidRefocus(const WebCore::Node*) override;
 #endif
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
     virtual bool supportsVideoFullscreen(WebCore::HTMLMediaElementEnums::VideoFullscreenMode) override;
     virtual void enterVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&, WebCore::HTMLMediaElementEnums::VideoFullscreenMode) override;
     virtual void exitVideoFullscreenForVideoElement(WebCore::HTMLVideoElement&) override;

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp (195754 => 195755)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.cpp	2016-01-28 18:28:16 UTC (rev 195755)
@@ -194,6 +194,7 @@
 #include "PDFPlugin.h"
 #include "RemoteLayerTreeTransaction.h"
 #include "WKStringCF.h"
+#include "WebVideoFullscreenManager.h"
 #include <WebCore/LegacyWebArchive.h>
 #endif
 
@@ -205,7 +206,6 @@
 
 #if PLATFORM(IOS)
 #include "RemoteLayerTreeDrawingArea.h"
-#include "WebVideoFullscreenManager.h"
 #include <CoreGraphics/CoreGraphics.h>
 #include <WebCore/CoreTextSPI.h>
 #include <WebCore/Icon.h>
@@ -3046,14 +3046,16 @@
     return m_inspectorUI.get();
 }
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 WebVideoFullscreenManager* WebPage::videoFullscreenManager()
 {
     if (!m_videoFullscreenManager)
         m_videoFullscreenManager = WebVideoFullscreenManager::create(this);
     return m_videoFullscreenManager.get();
 }
+#endif
 
+#if PLATFORM(IOS)
 void WebPage::setAllowsMediaDocumentInlinePlayback(bool allows)
 {
     m_page->setAllowsMediaDocumentInlinePlayback(allows);

Modified: trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h (195754 => 195755)


--- trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/WebProcess/WebPage/WebPage.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -249,8 +249,10 @@
     WebInspectorUI* inspectorUI();
     bool isInspectorPage() { return !!m_inspectorUI; }
 
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
+    WebVideoFullscreenManager* videoFullscreenManager();
+#endif
 #if PLATFORM(IOS)
-    WebVideoFullscreenManager* videoFullscreenManager();
     void setAllowsMediaDocumentInlinePlayback(bool);
     bool allowsMediaDocumentInlinePlayback() const { return m_allowsMediaDocumentInlinePlayback; }
 #endif
@@ -1281,8 +1283,10 @@
 
     RefPtr<WebInspector> m_inspector;
     RefPtr<WebInspectorUI> m_inspectorUI;
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
+    RefPtr<WebVideoFullscreenManager> m_videoFullscreenManager;
+#endif
 #if PLATFORM(IOS)
-    RefPtr<WebVideoFullscreenManager> m_videoFullscreenManager;
     bool m_allowsMediaDocumentInlinePlayback { false };
 #endif
 #if ENABLE(FULLSCREEN_API)

Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h (195754 => 195755)


--- trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h	2016-01-28 18:28:16 UTC (rev 195755)
@@ -25,7 +25,7 @@
 #ifndef WebVideoFullscreenManager_h
 #define WebVideoFullscreenManager_h
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 
 #include "MessageReceiver.h"
 #include <WebCore/EventListener.h>
@@ -172,6 +172,6 @@
     
 } // namespace WebKit
 
-#endif // PLATFORM(IOS)
+#endif // PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 
 #endif // WebVideoFullscreenManager_h

Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.messages.in (195754 => 195755)


--- trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.messages.in	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.messages.in	2016-01-28 18:28:16 UTC (rev 195755)
@@ -20,7 +20,7 @@
 # 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 PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 messages -> WebVideoFullscreenManager {
     Play(uint64_t contextId)
     Pause(uint64_t contextId)

Modified: trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm (195754 => 195755)


--- trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm	2016-01-28 18:18:18 UTC (rev 195754)
+++ trunk/Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm	2016-01-28 18:28:16 UTC (rev 195755)
@@ -25,7 +25,7 @@
 #import "config.h"
 #import "WebVideoFullscreenManager.h"
 
-#if PLATFORM(IOS)
+#if PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
 
 #import "Attachment.h"
 #import "WebCoreArgumentCoders.h"
@@ -45,7 +45,6 @@
 #import <WebCore/RenderView.h>
 #import <WebCore/Settings.h>
 #import <WebCore/TimeRanges.h>
-#import <WebCore/WebCoreThreadRun.h>
 #import <mach/mach_port.h>
 
 using namespace WebCore;
@@ -220,7 +219,12 @@
 
 bool WebVideoFullscreenManager::supportsVideoFullscreen() const
 {
+#if PLATFORM(IOS)
     return Settings::avKitEnabled();
+#else
+    // FIXME 153241: Return false until more of WebVideoFullscreenInterfaceMac has been implemented.
+    return false;
+#endif
 }
 
 void WebVideoFullscreenManager::enterVideoFullscreenForVideoElement(HTMLVideoElement& videoElement, HTMLMediaElementEnums::VideoFullscreenMode mode)
@@ -558,4 +562,4 @@
 
 } // namespace WebKit
 
-#endif // PLATFORM(IOS)
+#endif // PLATFORM(IOS) || (PLATFORM(MAC) && ENABLE(VIDEO_PRESENTATION_MODE))
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to