Get WebVideoFullscreenManager and related classes to also compile for Mac platform
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jan 2016 18:28:16 +0000 (18:28 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 28 Jan 2016 18:28:16 +0000 (18:28 +0000)
commit49ca7fcb3498f47ea7f09a6f2c2b85f674546073
treece78035db9a3fb9aaa296f556883475516a20fc5
parentcf68c5e049aa10eedd5a36cd8c5c3ce8af7a49b1
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.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@195755 268f45cc-cd09-0410-ab3c-d52691b4dbfc
28 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/platform/cocoa/PlatformView.h [new file with mode: 0644]
Source/WebCore/platform/cocoa/WebVideoFullscreenChangeObserver.h [new file with mode: 0644]
Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h
Source/WebCore/platform/cocoa/WebVideoFullscreenModel.h
Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.h
Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm
Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm
Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h [new file with mode: 0644]
Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h
Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in
Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
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/WebProcess/cocoa/WebVideoFullscreenManager.h
Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.messages.in
Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm