Allow WebVideoFullscreenManager and Proxy to be used by audio elements.
authorjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2016 17:50:26 +0000 (17:50 +0000)
committerjer.noble@apple.com <jer.noble@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 15 Apr 2016 17:50:26 +0000 (17:50 +0000)
commit93c1a5da916cecec6a0d94faa50c7d5ba53ac0cd
tree12b3af3766026415e2a1c140f7c14245c8ba3719
parentacbcedbc1ce195e09a69c1bac682f5b7479eed19
Allow WebVideoFullscreenManager and Proxy to be used by audio elements.
https://bugs.webkit.org/show_bug.cgi?id=156564

Reviewed by Beth Dakin.

Source/WebCore:

No new tests; this refactors existing functionality into new classes.

Tease apart the various WebVideoFullscreen{Interface,Model}{AVKit,Mac,VideoElement} into new
WebPlaybackSession… classes dealing exclusively with playback state and commands, leaving
fullscreen state and commands in the WebVideoFullscreen… classes. Specifically, create the
following new classes:

- WebPlaybackSessionInterface (copied from WebVideoFullscreenInterface)
- WebPlaybackSessionModelMediaElement (copied from WebVideoFullscreenModelMediaElement)
- WebPlaybackSessionModel (copied from WebVideoFullscreenModel)
- WebPlaybackSessionInterfaceAVKit (copied from WebVideoFullscreenInterfaceAVKit)
- WebPlaybackSessionInterfaceMac (copied from WebVideoFullscreenInterfaceMac)

WebVideoFullscreenInterface and WebVideoFullscreenModel now inherit from
WebPlaybackSessionInterface and WebPlaybackSessionModel, respectively. The concrete
WebVideoFullscreen… subclasses each take their respective WebPlaybackSession… subclasses and
fulfill their WebPlaybackSession interfaces through composition.

As part of this big tease-apart, the WebAVPlayerController class needs to be exposed in a
header (as it's accessed by two different classes now), so that class is moved into its own
implementation and header files.

The one case where a change in a WebPlaybackSession… class needs to be reflected in a
WebVideoFullscreen… class is in WebPlaybackSessionInterfaceAVKit, where
WebVideoFullscreenInterfaceAVKit needs to be notified when external playback becomes dis/en-
abled, so a new WebPlaybackSessionInterfaceAVKitClient interface has been added to allow the
WebPlaybackSession… to notify the WebVideoFullscreen….

The responsibility for the "controls manager" has moved from the WebVideoFullscreen… classes
to the WebPlaybackSession… classes, so the ChromeClient interface for creating and destroying
those controls is similarly renamed from setUpVideoControlsManager() to
setUpPlaybackControlsManager().

* WebCore.xcodeproj/project.pbxproj:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::updatePlayState):
* page/ChromeClient.h:
* platform/cocoa/WebPlaybackSessionInterface.h: Copied from Source/WebCore/platform/cocoa/WebVideoFullscreenInterface.h.
(WebCore::WebPlaybackSessionInterface::~WebPlaybackSessionInterface):
* platform/cocoa/WebPlaybackSessionModel.h: Added.
(WebCore::WebPlaybackSessionModel::~WebPlaybackSessionModel):
* platform/cocoa/WebPlaybackSessionModelMediaElement.h: Added.
(WebCore::WebPlaybackSessionModelMediaElement::create):
(WebCore::WebPlaybackSessionModelMediaElement::mediaElement):
* platform/cocoa/WebPlaybackSessionModelMediaElement.mm: Added.
(WebPlaybackSessionModelMediaElement::WebPlaybackSessionModelMediaElement):
(WebPlaybackSessionModelMediaElement::~WebPlaybackSessionModelMediaElement):
(WebPlaybackSessionModelMediaElement::setWebPlaybackSessionInterface):
(WebPlaybackSessionModelMediaElement::setMediaElement):
(WebPlaybackSessionModelMediaElement::handleEvent):
(WebPlaybackSessionModelMediaElement::updateForEventName):
(WebPlaybackSessionModelMediaElement::play):
(WebPlaybackSessionModelMediaElement::pause):
(WebPlaybackSessionModelMediaElement::togglePlayState):
(WebPlaybackSessionModelMediaElement::beginScrubbing):
(WebPlaybackSessionModelMediaElement::endScrubbing):
(WebPlaybackSessionModelMediaElement::seekToTime):
(WebPlaybackSessionModelMediaElement::fastSeek):
(WebPlaybackSessionModelMediaElement::beginScanningForward):
(WebPlaybackSessionModelMediaElement::beginScanningBackward):
(WebPlaybackSessionModelMediaElement::endScanning):
(WebPlaybackSessionModelMediaElement::selectAudioMediaOption):
(WebPlaybackSessionModelMediaElement::selectLegibleMediaOption):
(WebPlaybackSessionModelMediaElement::updateLegibleOptions):
(WebPlaybackSessionModelMediaElement::observedEventNames):
(WebPlaybackSessionModelMediaElement::eventNameAll):
* platform/cocoa/WebPlaybackSessionModelVideoElement.cpp: Copied from Source/WebCore/platform/cocoa/WebVideoFullscreenModelVideoElement.mm.
(WebPlaybackSessionModelVideoElement::WebPlaybackSessionModelVideoElement):
(WebPlaybackSessionModelVideoElement::~WebPlaybackSessionModelVideoElement):
(WebPlaybackSessionModelVideoElement::setWebVideoFullscreenInterface):
(WebPlaybackSessionModelVideoElement::setVideoElement):
(WebPlaybackSessionModelVideoElement::handleEvent):
(WebPlaybackSessionModelVideoElement::updateForEventName):
(WebPlaybackSessionModelVideoElement::play):
(WebPlaybackSessionModelVideoElement::pause):
(WebPlaybackSessionModelVideoElement::togglePlayState):
(WebPlaybackSessionModelVideoElement::beginScrubbing):
(WebPlaybackSessionModelVideoElement::endScrubbing):
(WebPlaybackSessionModelVideoElement::seekToTime):
(WebPlaybackSessionModelVideoElement::fastSeek):
(WebPlaybackSessionModelVideoElement::beginScanningForward):
(WebPlaybackSessionModelVideoElement::beginScanningBackward):
(WebPlaybackSessionModelVideoElement::endScanning):
(WebPlaybackSessionModelVideoElement::selectAudioMediaOption):
(WebPlaybackSessionModelVideoElement::selectLegibleMediaOption):
(WebPlaybackSessionModelVideoElement::updateLegibleOptions):
(WebPlaybackSessionModelVideoElement::observedEventNames):
(WebPlaybackSessionModelVideoElement::eventNameAll):
* platform/cocoa/WebVideoFullscreenInterface.h:
* platform/cocoa/WebVideoFullscreenModel.h:
(WebCore::WebVideoFullscreenModel::~WebVideoFullscreenModel): Deleted.
* platform/cocoa/WebVideoFullscreenModelVideoElement.h:
(WebCore::WebVideoFullscreenModelVideoElement::create):
* platform/cocoa/WebVideoFullscreenModelVideoElement.mm:
(WebVideoFullscreenModelVideoElement::WebVideoFullscreenModelVideoElement):
(WebVideoFullscreenModelVideoElement::setWebVideoFullscreenInterface):
(WebVideoFullscreenModelVideoElement::setVideoElement):
(WebVideoFullscreenModelVideoElement::play):
(WebVideoFullscreenModelVideoElement::pause):
(WebVideoFullscreenModelVideoElement::togglePlayState):
(WebVideoFullscreenModelVideoElement::beginScrubbing):
(WebVideoFullscreenModelVideoElement::endScrubbing):
(WebVideoFullscreenModelVideoElement::seekToTime):
(WebVideoFullscreenModelVideoElement::fastSeek):
(WebVideoFullscreenModelVideoElement::beginScanningForward):
(WebVideoFullscreenModelVideoElement::beginScanningBackward):
(WebVideoFullscreenModelVideoElement::endScanning):
(WebVideoFullscreenModelVideoElement::selectAudioMediaOption):
(WebVideoFullscreenModelVideoElement::selectLegibleMediaOption):
(WebVideoFullscreenModelVideoElement::handleEvent): Deleted.
(WebVideoFullscreenModelVideoElement::setVideoFullscreenLayer): Deleted.
(WebVideoFullscreenModelVideoElement::setVideoLayerFrame): Deleted.
(WebVideoFullscreenModelVideoElement::setVideoLayerGravity): Deleted.
(WebVideoFullscreenModelVideoElement::observedEventNames): Deleted.
(WebVideoFullscreenModelVideoElement::eventNameAll): Deleted.
(WebVideoFullscreenModelVideoElement::fullscreenModeChanged): Deleted.
(WebVideoFullscreenModelVideoElement::isVisible): Deleted.
* platform/ios/WebAVPlayerController.h: Added.
* platform/ios/WebAVPlayerController.mm: Added.
(-[WebAVPlayerController dealloc]):
(-[WebAVPlayerController resetState]):
(-[WebAVPlayerController player]):
(-[WebAVPlayerController forwardingTargetForSelector:]):
(-[WebAVPlayerController play:]):
(-[WebAVPlayerController pause:]):
(-[WebAVPlayerController togglePlayback:]):
(-[WebAVPlayerController togglePlaybackEvenWhenInBackground:]):
(-[WebAVPlayerController isPlaying]):
(-[WebAVPlayerController setPlaying:]):
(+[WebAVPlayerController keyPathsForValuesAffectingPlaying]):
(-[WebAVPlayerController beginScrubbing:]):
(-[WebAVPlayerController endScrubbing:]):
(-[WebAVPlayerController seekToTime:]):
(-[WebAVPlayerController currentTimeWithinEndTimes]):
(-[WebAVPlayerController setCurrentTimeWithinEndTimes:]):
(+[WebAVPlayerController keyPathsForValuesAffectingCurrentTimeWithinEndTimes]):
(-[WebAVPlayerController hasLiveStreamingContent]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasLiveStreamingContent]):
(-[WebAVPlayerController skipBackwardThirtySeconds:]):
(-[WebAVPlayerController gotoEndOfSeekableRanges:]):
(-[WebAVPlayerController canScanForward]):
(+[WebAVPlayerController keyPathsForValuesAffectingCanScanForward]):
(-[WebAVPlayerController beginScanningForward:]):
(-[WebAVPlayerController endScanningForward:]):
(-[WebAVPlayerController beginScanningBackward:]):
(-[WebAVPlayerController endScanningBackward:]):
(-[WebAVPlayerController canSeekToBeginning]):
(+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToBeginning]):
(-[WebAVPlayerController seekToBeginning:]):
(-[WebAVPlayerController seekChapterBackward:]):
(-[WebAVPlayerController canSeekToEnd]):
(+[WebAVPlayerController keyPathsForValuesAffectingCanSeekToEnd]):
(-[WebAVPlayerController seekToEnd:]):
(-[WebAVPlayerController seekChapterForward:]):
(-[WebAVPlayerController hasMediaSelectionOptions]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasMediaSelectionOptions]):
(-[WebAVPlayerController hasAudioMediaSelectionOptions]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasAudioMediaSelectionOptions]):
(-[WebAVPlayerController hasLegibleMediaSelectionOptions]):
(+[WebAVPlayerController keyPathsForValuesAffectingHasLegibleMediaSelectionOptions]):
(-[WebAVPlayerController currentAudioMediaSelectionOption]):
(-[WebAVPlayerController setCurrentAudioMediaSelectionOption:]):
(-[WebAVPlayerController currentLegibleMediaSelectionOption]):
(-[WebAVPlayerController setCurrentLegibleMediaSelectionOption:]):
(-[WebAVPlayerController isPlayingOnExternalScreen]):
(+[WebAVPlayerController keyPathsForValuesAffectingPlayingOnExternalScreen]):
(-[WebAVPlayerController isPictureInPictureInterrupted]):
(-[WebAVPlayerController setPictureInPictureInterrupted:]):
* platform/ios/WebPlaybackSessionInterfaceAVKit.h: Added.
(WebCore::WebPlaybackSessionInterfaceAVKitClient::~WebPlaybackSessionInterfaceAVKitClient):
* platform/ios/WebPlaybackSessionInterfaceAVKit.mm: Added.
(WebCore::WebPlaybackSessionInterfaceAVKit::WebPlaybackSessionInterfaceAVKit):
(WebCore::WebPlaybackSessionInterfaceAVKit::~WebPlaybackSessionInterfaceAVKit):
(WebCore::WebPlaybackSessionInterfaceAVKit::resetMediaState):
(WebCore::WebPlaybackSessionInterfaceAVKit::setWebPlaybackSessionModel):
(WebCore::WebPlaybackSessionInterfaceAVKit::setDuration):
(WebCore::WebPlaybackSessionInterfaceAVKit::setCurrentTime):
(WebCore::WebPlaybackSessionInterfaceAVKit::setBufferedTime):
(WebCore::WebPlaybackSessionInterfaceAVKit::setRate):
(WebCore::WebPlaybackSessionInterfaceAVKit::setSeekableRanges):
(WebCore::WebPlaybackSessionInterfaceAVKit::setCanPlayFastReverse):
(WebCore::mediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceAVKit::setAudioMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceAVKit::setLegibleMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceAVKit::setExternalPlayback):
(WebCore::WebPlaybackSessionInterfaceAVKit::setWirelessVideoPlaybackDisabled):
(WebCore::WebPlaybackSessionInterfaceAVKit::wirelessVideoPlaybackDisabled):
(WebCore::WebPlaybackSessionInterfaceAVKit::invalidate):
* platform/ios/WebVideoFullscreenControllerAVKit.mm:
(WebVideoFullscreenControllerContext::setUpFullscreen):
* platform/ios/WebVideoFullscreenInterfaceAVKit.h:
* platform/ios/WebVideoFullscreenInterfaceAVKit.mm:
(-[WebAVPlayerViewControllerDelegate fullscreenInterface]):
(-[WebAVPlayerViewControllerDelegate setFullscreenInterface:]):
(-[WebAVPlayerLayer fullscreenInterface]):
(-[WebAVPlayerLayer setFullscreenInterface:]):
(-[WebAVPlayerLayer layoutSublayers]):
(-[WebAVPlayerLayer resolveBounds]):
(-[WebAVPlayerLayer setVideoGravity:]):
(WebVideoFullscreenInterfaceAVKit::create):
(WebVideoFullscreenInterfaceAVKit::WebVideoFullscreenInterfaceAVKit):
(WebVideoFullscreenInterfaceAVKit::~WebVideoFullscreenInterfaceAVKit):
(WebVideoFullscreenInterfaceAVKit::playerController):
(WebVideoFullscreenInterfaceAVKit::resetMediaState):
(WebVideoFullscreenInterfaceAVKit::setDuration):
(WebVideoFullscreenInterfaceAVKit::setCurrentTime):
(WebVideoFullscreenInterfaceAVKit::setBufferedTime):
(WebVideoFullscreenInterfaceAVKit::setRate):
(WebVideoFullscreenInterfaceAVKit::setVideoDimensions):
(WebVideoFullscreenInterfaceAVKit::setSeekableRanges):
(WebVideoFullscreenInterfaceAVKit::setCanPlayFastReverse):
(WebVideoFullscreenInterfaceAVKit::setAudioMediaSelectionOptions):
(WebVideoFullscreenInterfaceAVKit::setLegibleMediaSelectionOptions):
(WebVideoFullscreenInterfaceAVKit::setExternalPlayback):
(WebVideoFullscreenInterfaceAVKit::externalPlaybackEnabledChanged):
(WebVideoFullscreenInterfaceAVKit::setWirelessVideoPlaybackDisabled):
(WebVideoFullscreenInterfaceAVKit::wirelessVideoPlaybackDisabled):
(WebVideoFullscreenInterfaceAVKit::setupFullscreen):
(WebVideoFullscreenInterfaceAVKit::cleanupFullscreen):
(WebVideoFullscreenInterfaceAVKit::mayAutomaticallyShowVideoPictureInPicture):
(-[WebAVPlayerViewControllerDelegate playerViewControllerWillStartPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerDidStartPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerFailedToStartPictureInPicture:withError:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerWillStopPictureInPicture:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewControllerDidStopPictureInPicture:]): Deleted.
(convertToExitFullScreenReason): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewController:shouldExitFullScreenWithReason:]): Deleted.
(-[WebAVPlayerViewControllerDelegate playerViewController:restoreUserInterfaceForPictureInPictureStopWithCompletionHandler:]): Deleted.
(-[WebAVPlayerLayer init]): Deleted.
(-[WebAVPlayerLayer dealloc]): Deleted.
(-[WebAVPlayerLayer videoGravity]): Deleted.
(-[WebAVPlayerLayer videoRect]): Deleted.
(+[WebAVPlayerLayer keyPathsForValuesAffectingVideoRect]): Deleted.
(WebAVPictureInPicturePlayerLayerView_layerClass): Deleted.
(getWebAVPictureInPicturePlayerLayerViewClass): Deleted.
(WebAVPlayerLayerView_layerClass): Deleted.
(WebAVPlayerLayerView_playerController): Deleted.
(WebAVPlayerLayerView_setPlayerController): Deleted.
(WebAVPlayerLayerView_videoView): Deleted.
(WebAVPlayerLayerView_setVideoView): Deleted.
(WebAVPlayerLayerView_startRoutingVideoToPictureInPicturePlayerLayerView): Deleted.
(WebAVPlayerLayerView_stopRoutingVideoToPictureInPicturePlayerLayerView): Deleted.
(WebAVPlayerLayerView_pictureInPicturePlayerLayerView): Deleted.
(WebAVPlayerLayerView_dealloc): Deleted.
(getWebAVPlayerLayerViewClass): Deleted.
(WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenModel): Deleted.
(WebVideoFullscreenInterfaceAVKit::setWebVideoFullscreenChangeObserver): Deleted.
(WebVideoFullscreenInterfaceAVKit::applicationDidBecomeActive): Deleted.
(WebVideoFullscreenInterfaceAVKit::enterFullscreen): Deleted.
(WebVideoFullscreenInterfaceAVKit::enterFullscreenStandard): Deleted.
(WebVideoFullscreenInterfaceAVKit::exitFullscreen): Deleted.
(WebVideoFullscreenInterfaceAVKit::didStartPictureInPicture): Deleted.
(WebVideoFullscreenInterfaceAVKit::failedToStartPictureInPicture): Deleted.
(WebVideoFullscreenInterfaceAVKit::willStopPictureInPicture): Deleted.
(WebVideoFullscreenInterfaceAVKit::didStopPictureInPicture): Deleted.
(WebVideoFullscreenInterfaceAVKit::prepareForPictureInPictureStopWithCompletionHandler): Deleted.
(WebVideoFullscreenInterfaceAVKit::shouldExitFullscreenWithReason): Deleted.
(WebVideoFullscreenInterfaceAVKit::watchdogTimerFired): Deleted.
(WebVideoFullscreenInterfaceAVKit::setMode): Deleted.
(WebVideoFullscreenInterfaceAVKit::clearMode): Deleted.
(WebCore::supportsPictureInPicture): Deleted.
* platform/mac/WebPlaybackSessionInterfaceMac.h: Added.
* platform/mac/WebPlaybackSessionInterfaceMac.mm: Copied from Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm.
(-[WebAVMediaSelectionOptionMac localizedDisplayName]):
(-[WebAVMediaSelectionOptionMac setLocalizedDisplayName:]):
(-[WebPlaybackControlsManager initWithWebPlaybackSessionInterfaceMac:]):
(-[WebPlaybackControlsManager timing]):
(-[WebPlaybackControlsManager setTiming:]):
(-[WebPlaybackControlsManager seekableTimeRanges]):
(-[WebPlaybackControlsManager setSeekableTimeRanges:]):
(-[WebPlaybackControlsManager isSeeking]):
(-[WebPlaybackControlsManager seekToTime:toleranceBefore:toleranceAfter:]):
(-[WebPlaybackControlsManager audioMediaSelectionOptions]):
(-[WebPlaybackControlsManager setAudioMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentAudioMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentAudioMediaSelectionOption:]):
(-[WebPlaybackControlsManager legibleMediaSelectionOptions]):
(-[WebPlaybackControlsManager setLegibleMediaSelectionOptions:]):
(-[WebPlaybackControlsManager currentLegibleMediaSelectionOption]):
(-[WebPlaybackControlsManager setCurrentLegibleMediaSelectionOption:]):
(-[WebPlaybackControlsManager cancelThumbnailAndAudioAmplitudeSampleGeneration]):
(WebCore::WebPlaybackSessionInterfaceMac::~WebPlaybackSessionInterfaceMac):
(WebCore::WebPlaybackSessionInterfaceMac::setWebPlaybackSessionModel):
(WebCore::WebPlaybackSessionInterfaceMac::setDuration):
(WebCore::WebPlaybackSessionInterfaceMac::setCurrentTime):
(WebCore::WebPlaybackSessionInterfaceMac::setRate):
(WebCore::WebPlaybackSessionInterfaceMac::setSeekableRanges):
(WebCore::mediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceMac::setAudioMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceMac::setLegibleMediaSelectionOptions):
(WebCore::WebPlaybackSessionInterfaceMac::invalidate):
(WebCore::WebPlaybackSessionInterfaceMac::ensureControlsManager):
(WebCore::WebPlaybackSessionInterfaceMac::playBackControlsManager):
* platform/mac/WebVideoFullscreenInterfaceMac.h:
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::WebVideoFullscreenInterfaceMac):
(WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenModel):
(WebCore::WebVideoFullscreenInterfaceMac::setDuration):
(WebCore::WebVideoFullscreenInterfaceMac::setCurrentTime):
(WebCore::WebVideoFullscreenInterfaceMac::setRate):
(WebCore::WebVideoFullscreenInterfaceMac::setSeekableRanges):
(WebCore::WebVideoFullscreenInterfaceMac::setAudioMediaSelectionOptions):
(WebCore::WebVideoFullscreenInterfaceMac::setLegibleMediaSelectionOptions):
(WebCore::WebVideoFullscreenInterfaceMac::ensureControlsManager):
(WebCore::WebVideoFullscreenInterfaceMac::~WebVideoFullscreenInterfaceMac): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::setWebVideoFullscreenChangeObserver): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::setMode): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::clearMode): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::setupFullscreen): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::enterFullscreen): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::exitFullscreen): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::exitFullscreenWithoutAnimationToMode): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::cleanupFullscreen): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::invalidate): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::preparedToReturnToInline): Deleted.
(WebCore::WebVideoFullscreenInterfaceMac::setVideoDimensions): Deleted.
(WebCore::supportsPictureInPicture): Deleted.

Source/WebKit2:

Tease apart WebVideoFullscreenManager and …Proxy into WebPlaybackSessionManager and …Proxy
classes dealing exclusively with playback state and commands, leaving fullscreen state and
commands in the WebVideoFullscreenManager… classes.

WebVideoFullscreenManager and …Proxy will now require an associated
WebPlaybackSessionManager and …Proxy class. The WebPlaybackSessionManager classes can be
used separately and without the WebVideoFullscreenManager classes.

* DerivedSources.make:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _mayAutomaticallyShowVideoPictureInPicture]):
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h: Copied from Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h.
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in: Copied from Source/WebKit2/UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in.
* UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm: Added.
(WebKit::WebPlaybackSessionModelContext::play):
(WebKit::WebPlaybackSessionModelContext::pause):
(WebKit::WebPlaybackSessionModelContext::togglePlayState):
(WebKit::WebPlaybackSessionModelContext::beginScrubbing):
(WebKit::WebPlaybackSessionModelContext::endScrubbing):
(WebKit::WebPlaybackSessionModelContext::seekToTime):
(WebKit::WebPlaybackSessionModelContext::fastSeek):
(WebKit::WebPlaybackSessionModelContext::beginScanningForward):
(WebKit::WebPlaybackSessionModelContext::beginScanningBackward):
(WebKit::WebPlaybackSessionModelContext::endScanning):
(WebKit::WebPlaybackSessionModelContext::selectAudioMediaOption):
(WebKit::WebPlaybackSessionModelContext::selectLegibleMediaOption):
(WebKit::WebPlaybackSessionManagerProxy::create):
(WebKit::WebPlaybackSessionManagerProxy::WebPlaybackSessionManagerProxy):
(WebKit::WebPlaybackSessionManagerProxy::~WebPlaybackSessionManagerProxy):
(WebKit::WebPlaybackSessionManagerProxy::invalidate):
(WebKit::WebPlaybackSessionManagerProxy::createModelAndInterface):
(WebKit::WebPlaybackSessionManagerProxy::ensureModelAndInterface):
(WebKit::WebPlaybackSessionManagerProxy::ensureModel):
(WebKit::WebPlaybackSessionManagerProxy::ensureInterface):
(WebKit::WebPlaybackSessionManagerProxy::addClientForContext):
(WebKit::WebPlaybackSessionManagerProxy::removeClientForContext):
(WebKit::WebPlaybackSessionManagerProxy::setUpPlaybackControlsManagerWithID):
(WebKit::WebPlaybackSessionManagerProxy::clearPlaybackControlsManager):
(WebKit::WebPlaybackSessionManagerProxy::resetMediaState):
(WebKit::WebPlaybackSessionManagerProxy::setCurrentTime):
(WebKit::WebPlaybackSessionManagerProxy::setBufferedTime):
(WebKit::WebPlaybackSessionManagerProxy::setSeekableRangesVector):
(WebKit::WebPlaybackSessionManagerProxy::setCanPlayFastReverse):
(WebKit::WebPlaybackSessionManagerProxy::setAudioMediaSelectionOptions):
(WebKit::WebPlaybackSessionManagerProxy::setLegibleMediaSelectionOptions):
(WebKit::WebPlaybackSessionManagerProxy::setExternalPlaybackProperties):
(WebKit::WebPlaybackSessionManagerProxy::setWirelessVideoPlaybackDisabled):
(WebKit::WebPlaybackSessionManagerProxy::setDuration):
(WebKit::WebPlaybackSessionManagerProxy::setRate):
(WebKit::WebPlaybackSessionManagerProxy::play):
(WebKit::WebPlaybackSessionManagerProxy::pause):
(WebKit::WebPlaybackSessionManagerProxy::togglePlayState):
(WebKit::WebPlaybackSessionManagerProxy::beginScrubbing):
(WebKit::WebPlaybackSessionManagerProxy::endScrubbing):
(WebKit::WebPlaybackSessionManagerProxy::seekToTime):
(WebKit::WebPlaybackSessionManagerProxy::fastSeek):
(WebKit::WebPlaybackSessionManagerProxy::beginScanningForward):
(WebKit::WebPlaybackSessionManagerProxy::beginScanningBackward):
(WebKit::WebPlaybackSessionManagerProxy::endScanning):
(WebKit::WebPlaybackSessionManagerProxy::selectAudioMediaOption):
(WebKit::WebPlaybackSessionManagerProxy::selectLegibleMediaOption):
(WebKit::WebPlaybackSessionManagerProxy::controlsManagerInterface):
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.h:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.messages.in:
* UIProcess/Cocoa/WebVideoFullscreenManagerProxy.mm:
(WebKit::WebVideoFullscreenModelContext::WebVideoFullscreenModelContext):
(WebKit::WebVideoFullscreenModelContext::~WebVideoFullscreenModelContext):
(WebKit::WebVideoFullscreenModelContext::play):
(WebKit::WebVideoFullscreenModelContext::pause):
(WebKit::WebVideoFullscreenModelContext::togglePlayState):
(WebKit::WebVideoFullscreenModelContext::beginScrubbing):
(WebKit::WebVideoFullscreenModelContext::endScrubbing):
(WebKit::WebVideoFullscreenModelContext::seekToTime):
(WebKit::WebVideoFullscreenModelContext::fastSeek):
(WebKit::WebVideoFullscreenModelContext::beginScanningForward):
(WebKit::WebVideoFullscreenModelContext::beginScanningBackward):
(WebKit::WebVideoFullscreenModelContext::endScanning):
(WebKit::WebVideoFullscreenModelContext::selectAudioMediaOption):
(WebKit::WebVideoFullscreenModelContext::selectLegibleMediaOption):
(WebKit::WebVideoFullscreenManagerProxy::create):
(WebKit::WebVideoFullscreenManagerProxy::WebVideoFullscreenManagerProxy):
(WebKit::WebVideoFullscreenManagerProxy::createModelAndInterface):
(WebKit::WebVideoFullscreenManagerProxy::setupFullscreenWithID): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::setVideoDimensions): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::enterFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::exitFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::exitFullscreenWithoutAnimationToMode): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::cleanupFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::preparedToReturnToInline): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::requestFullscreenMode): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::didSetupFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::didExitFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::didEnterFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::didCleanupFullscreen): Deleted.
(WebKit::WebVideoFullscreenManagerProxy::setVideoLayerFrame): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::WebPageProxy):
(WebKit::WebPageProxy::reattachToWebProcess):
(WebKit::WebPageProxy::playbackSessionManager):
(WebKit::WebPageProxy::videoFullscreenManager):
(WebKit::WebPageProxy::resetState):
(WebKit::WebPageProxy::hasActiveVideoForControlsManager):
(WebKit::WebPageProxy::isPlayingMediaDidChange): Deleted.
* UIProcess/WebPageProxy.h:
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::supportsVideoFullscreen):
(WebKit::WebChromeClient::setUpPlaybackControlsManager):
(WebKit::WebChromeClient::clearPlaybackControlsManager):
(WebKit::WebChromeClient::enterVideoFullscreenForVideoElement):
(WebKit::WebChromeClient::exitVideoFullscreenForVideoElement):
(WebKit::WebChromeClient::exitVideoFullscreenToModeWithoutAnimation):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::playbackSessionManager):
(WebKit::WebPage::videoFullscreenManager):
* WebProcess/WebPage/WebPage.h:
* WebProcess/cocoa/WebPlaybackSessionManager.h: Copied from Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h.
(WebKit::WebPlaybackSessionInterfaceContext::create):
(WebKit::WebPlaybackSessionInterfaceContext::invalidate):
* WebProcess/cocoa/WebPlaybackSessionManager.messages.in: Added.
* WebProcess/cocoa/WebPlaybackSessionManager.mm: Added.
(WebKit::nextContextId):
(WebKit::WebPlaybackSessionInterfaceContext::WebPlaybackSessionInterfaceContext):
(WebKit::WebPlaybackSessionInterfaceContext::~WebPlaybackSessionInterfaceContext):
(WebKit::WebPlaybackSessionInterfaceContext::resetMediaState):
(WebKit::WebPlaybackSessionInterfaceContext::setDuration):
(WebKit::WebPlaybackSessionInterfaceContext::setCurrentTime):
(WebKit::WebPlaybackSessionInterfaceContext::setBufferedTime):
(WebKit::WebPlaybackSessionInterfaceContext::setRate):
(WebKit::WebPlaybackSessionInterfaceContext::setSeekableRanges):
(WebKit::WebPlaybackSessionInterfaceContext::setCanPlayFastReverse):
(WebKit::WebPlaybackSessionInterfaceContext::setAudioMediaSelectionOptions):
(WebKit::WebPlaybackSessionInterfaceContext::setLegibleMediaSelectionOptions):
(WebKit::WebPlaybackSessionInterfaceContext::setExternalPlayback):
(WebKit::WebPlaybackSessionInterfaceContext::setWirelessVideoPlaybackDisabled):
(WebKit::WebPlaybackSessionManager::create):
(WebKit::WebPlaybackSessionManager::WebPlaybackSessionManager):
(WebKit::WebPlaybackSessionManager::~WebPlaybackSessionManager):
(WebKit::WebPlaybackSessionManager::createModelAndInterface):
(WebKit::WebPlaybackSessionManager::ensureModelAndInterface):
(WebKit::WebPlaybackSessionManager::ensureModel):
(WebKit::WebPlaybackSessionManager::ensureInterface):
(WebKit::WebPlaybackSessionManager::removeContext):
(WebKit::WebPlaybackSessionManager::addClientForContext):
(WebKit::WebPlaybackSessionManager::removeClientForContext):
(WebKit::WebPlaybackSessionManager::setUpPlaybackControlsManager):
(WebKit::WebPlaybackSessionManager::clearPlaybackControlsManager):
(WebKit::WebPlaybackSessionManager::contextIdForMediaElement):
(WebKit::WebPlaybackSessionManager::resetMediaState):
(WebKit::WebPlaybackSessionManager::setDuration):
(WebKit::WebPlaybackSessionManager::setCurrentTime):
(WebKit::WebPlaybackSessionManager::setBufferedTime):
(WebKit::WebPlaybackSessionManager::setRate):
(WebKit::WebPlaybackSessionManager::setSeekableRanges):
(WebKit::WebPlaybackSessionManager::setCanPlayFastReverse):
(WebKit::WebPlaybackSessionManager::setAudioMediaSelectionOptions):
(WebKit::WebPlaybackSessionManager::setLegibleMediaSelectionOptions):
(WebKit::WebPlaybackSessionManager::setExternalPlayback):
(WebKit::WebPlaybackSessionManager::setWirelessVideoPlaybackDisabled):
(WebKit::WebPlaybackSessionManager::play):
(WebKit::WebPlaybackSessionManager::pause):
(WebKit::WebPlaybackSessionManager::togglePlayState):
(WebKit::WebPlaybackSessionManager::beginScrubbing):
(WebKit::WebPlaybackSessionManager::endScrubbing):
(WebKit::WebPlaybackSessionManager::seekToTime):
(WebKit::WebPlaybackSessionManager::fastSeek):
(WebKit::WebPlaybackSessionManager::beginScanningForward):
(WebKit::WebPlaybackSessionManager::beginScanningBackward):
(WebKit::WebPlaybackSessionManager::endScanning):
(WebKit::WebPlaybackSessionManager::selectAudioMediaOption):
(WebKit::WebPlaybackSessionManager::selectLegibleMediaOption):
* WebProcess/cocoa/WebVideoFullscreenManager.h:
(WebKit::WebVideoFullscreenInterfaceContext::create):
* WebProcess/cocoa/WebVideoFullscreenManager.messages.in:
* WebProcess/cocoa/WebVideoFullscreenManager.mm:
(WebKit::WebVideoFullscreenInterfaceContext::WebVideoFullscreenInterfaceContext):
(WebKit::WebVideoFullscreenInterfaceContext::resetMediaState):
(WebKit::WebVideoFullscreenInterfaceContext::setDuration):
(WebKit::WebVideoFullscreenInterfaceContext::setCurrentTime):
(WebKit::WebVideoFullscreenInterfaceContext::setBufferedTime):
(WebKit::WebVideoFullscreenInterfaceContext::setRate):
(WebKit::WebVideoFullscreenInterfaceContext::setSeekableRanges):
(WebKit::WebVideoFullscreenInterfaceContext::setCanPlayFastReverse):
(WebKit::WebVideoFullscreenInterfaceContext::setAudioMediaSelectionOptions):
(WebKit::WebVideoFullscreenInterfaceContext::setLegibleMediaSelectionOptions):
(WebKit::WebVideoFullscreenInterfaceContext::setExternalPlayback):
(WebKit::WebVideoFullscreenInterfaceContext::setWirelessVideoPlaybackDisabled):
(WebKit::WebVideoFullscreenManager::create):
(WebKit::WebVideoFullscreenManager::WebVideoFullscreenManager):
(WebKit::WebVideoFullscreenManager::createModelAndInterface):
(WebKit::WebVideoFullscreenManager::enterVideoFullscreenForVideoElement):
(WebKit::WebVideoFullscreenInterfaceContext::setVideoDimensions): Deleted.
(WebKit::WebVideoFullscreenManager::~WebVideoFullscreenManager): Deleted.
(WebKit::WebVideoFullscreenManager::ensureModelAndInterface): Deleted.
(WebKit::WebVideoFullscreenManager::exitVideoFullscreenToModeWithoutAnimation): Deleted.
(WebKit::WebVideoFullscreenManager::setVideoDimensions): Deleted.
(WebKit::WebVideoFullscreenManager::requestFullscreenMode): Deleted.
(WebKit::WebVideoFullscreenManager::fullscreenModeChanged): Deleted.
(WebKit::WebVideoFullscreenManager::didSetupFullscreen): Deleted.
(WebKit::WebVideoFullscreenManager::didEnterFullscreen): Deleted.
(WebKit::WebVideoFullscreenManager::didExitFullscreen): Deleted.
(WebKit::WebVideoFullscreenManager::didCleanupFullscreen): Deleted.
(WebKit::WebVideoFullscreenManager::setVideoLayerGravityEnum): Deleted.
(WebKit::WebVideoFullscreenManager::fullscreenMayReturnToInline): Deleted.
(WebKit::WebVideoFullscreenManager::setVideoLayerFrameFenced): Deleted.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@199593 268f45cc-cd09-0410-ab3c-d52691b4dbfc
45 files changed:
Source/WebCore/ChangeLog
Source/WebCore/WebCore.xcodeproj/project.pbxproj
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/page/ChromeClient.h
Source/WebCore/platform/cocoa/WebPlaybackSessionInterface.h [new file with mode: 0644]
Source/WebCore/platform/cocoa/WebPlaybackSessionModel.h [new file with mode: 0644]
Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.h [new file with mode: 0644]
Source/WebCore/platform/cocoa/WebPlaybackSessionModelMediaElement.mm [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/WebAVPlayerController.h [new file with mode: 0644]
Source/WebCore/platform/ios/WebAVPlayerController.mm [new file with mode: 0644]
Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.h [new file with mode: 0644]
Source/WebCore/platform/ios/WebPlaybackSessionInterfaceAVKit.mm [new file with mode: 0644]
Source/WebCore/platform/ios/WebVideoFullscreenControllerAVKit.mm
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.h
Source/WebCore/platform/ios/WebVideoFullscreenInterfaceAVKit.mm
Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.h [new file with mode: 0644]
Source/WebCore/platform/mac/WebPlaybackSessionInterfaceMac.mm [new file with mode: 0644]
Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h
Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm
Source/WebKit2/ChangeLog
Source/WebKit2/DerivedSources.make
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.h [new file with mode: 0644]
Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.messages.in [new file with mode: 0644]
Source/WebKit2/UIProcess/Cocoa/WebPlaybackSessionManagerProxy.mm [new file with mode: 0644]
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/WebKit2.xcodeproj/project.pbxproj
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/WebPlaybackSessionManager.h [new file with mode: 0644]
Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.messages.in [new file with mode: 0644]
Source/WebKit2/WebProcess/cocoa/WebPlaybackSessionManager.mm [new file with mode: 0644]
Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.h
Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.messages.in
Source/WebKit2/WebProcess/cocoa/WebVideoFullscreenManager.mm