Add support for AirPlay picker in WK2 for iOS.
authorenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Mar 2014 23:41:46 +0000 (23:41 +0000)
committerenrica@apple.com <enrica@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 27 Mar 2014 23:41:46 +0000 (23:41 +0000)
commit23eb8fe9992125ff2fbffd1f0d3c0c5855ad0182
treee36702a86627cee3ce1de4d0476fa8508352c5df
parent96a895efe1455cf13325b205d70e2d74159ce95e
Add support for AirPlay picker in WK2 for iOS.
https://bugs.webkit.org/show_bug.cgi?id=130855
<rdar://problem/15349859>

Source/WebCore:

Reviewed by Eric Carlson, Joseph Pecoraro and Benjamin Poulain.

Adds support in HTMLMediaSession to display the airplay picker
and to monitor presence of available wireless targets.

* html/HTMLMediaSession.cpp:
(WebCore::HTMLMediaSession::showPlaybackTargetPicker):
(WebCore::HTMLMediaSession::hasWirelessPlaybackTargets):
(WebCore::HTMLMediaSession::setHasPlaybackTargetAvailabilityListeners):
* loader/EmptyClients.h:
* page/ChromeClient.h:
* platform/audio/MediaSessionManager.cpp:
(WebCore::MediaSessionManager::wirelessRoutesAvailableChanged):
* platform/audio/MediaSessionManager.h:
(WebCore::MediaSessionManager::hasWirelessTargetsAvailable):
(WebCore::MediaSessionManager::startMonitoringAirPlayRoutes):
(WebCore::MediaSessionManager::stopMonitoringAirPlayRoutes):
* platform/audio/ios/MediaSessionManagerIOS.h:
* platform/audio/ios/MediaSessionManagerIOS.mm:
(WebCore::MediaSessionManageriOS::hasWirelessTargetsAvailable):
(WebCore::MediaSessionManageriOS::startMonitoringAirPlayRoutes):
(WebCore::MediaSessionManageriOS::stopMonitoringAirPlayRoutes):
(-[WebMediaSessionHelper initWithCallback:]):
(-[WebMediaSessionHelper hasWirelessTargetsAvailable]):
(-[WebMediaSessionHelper startMonitoringAirPlayRoutes]):
(-[WebMediaSessionHelper stopMonitoringAirPlayRoutes]):
(-[WebMediaSessionHelper wirelessRoutesAvailableDidChange:]):
* platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm:
(WebCore::MediaPlayerPrivateAVFoundationObjC::wirelessVideoPlaybackDisabled):
(WebCore::MediaPlayerPrivateAVFoundationObjC::setWirelessVideoPlaybackDisabled):

Source/WebKit/ios:

Reviewed by Eric Carlson, Joseph Pecoraro and Benjamin Poulain.

Adds stub for new WebKit chrome client method.

* WebCoreSupport/WebChromeClientIOS.h:
* WebCoreSupport/WebChromeClientIOS.mm:
(WebChromeClientIOS::showAirPlayRoutePicker):

Source/WebKit2:

Reviewed by Joseph Pecoraro and Benjamin Poulain.

Adds support to display the airplay picker for iPhone and iPad
in WK2.
The picker on iPad is displayed next to the airplay button.

* UIProcess/PageClient.h:
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/ios/PageClientImplIOS.h:
* UIProcess/ios/PageClientImplIOS.mm:
(WebKit::PageClientImpl::showAirPlayRoutePicker):
* UIProcess/ios/WKContentViewInteraction.h:
* UIProcess/ios/WKContentViewInteraction.mm:
(-[WKContentView _showAirPlayRoutePicker:fromRect:]):
* UIProcess/ios/WebPageProxyIOS.mm:
(WebKit::WebPageProxy::showAirPlayRoutePicker):
* UIProcess/ios/forms/WKAirPlayRoutePicker.h: Added.
* UIProcess/ios/forms/WKAirPlayRoutePicker.mm: Added.
(-[WKAirPlayRoutePicker initWithView:]):
(-[WKAirPlayRoutePicker dealloc]):
(-[WKAirPlayRoutePicker popoverControllerDidDismissPopover:]):
(-[WKAirPlayRoutePicker _presentAirPlayPopoverAnimated:fromRect:]):
(-[WKAirPlayRoutePicker _windowWillRotate:]):
(-[WKAirPlayRoutePicker _windowDidRotate:]):
(-[WKAirPlayRoutePicker _dismissAirPlayRoutePickerIPad]):
(-[WKAirPlayRoutePicker showAirPlayPickerIPad:fromRect:]):
(-[WKAirPlayRoutePicker showAirPlayPickerIPhone:]):
(-[WKAirPlayRoutePicker show:fromRect:]):
* WebKit2.xcodeproj/project.pbxproj:
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm:
(WebKit::WebChromeClient::showAirPlayRoutePicker):
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::touchEvent):
(WebKit::WebPage::touchEventSyncForTesting):
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/ios/WebPageIOS.mm:
(WebKit::WebPage::rectForElementAtInteractionLocation):
(WebKit::WebPage::handleTap):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@166384 268f45cc-cd09-0410-ab3c-d52691b4dbfc
30 files changed:
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLMediaSession.cpp
Source/WebCore/loader/EmptyClients.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/platform/audio/MediaSessionManager.cpp
Source/WebCore/platform/audio/MediaSessionManager.h
Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.h
Source/WebCore/platform/audio/ios/MediaSessionManagerIOS.mm
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlayerPrivateAVFoundationObjC.mm
Source/WebKit/ios/ChangeLog
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.h
Source/WebKit/ios/WebCoreSupport/WebChromeClientIOS.mm
Source/WebKit/ios/WebCoreSupport/WebFrameIOS.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/PageClient.h
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/UIProcess/ios/PageClientImplIOS.h
Source/WebKit2/UIProcess/ios/PageClientImplIOS.mm
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.h
Source/WebKit2/UIProcess/ios/WKContentViewInteraction.mm
Source/WebKit2/UIProcess/ios/WebPageProxyIOS.mm
Source/WebKit2/UIProcess/ios/forms/WKAirPlayRoutePicker.h [new file with mode: 0644]
Source/WebKit2/UIProcess/ios/forms/WKAirPlayRoutePicker.mm [new file with mode: 0644]
Source/WebKit2/WebKit2.xcodeproj/project.pbxproj
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit2/WebProcess/WebCoreSupport/ios/WebChromeClientIOS.mm
Source/WebKit2/WebProcess/WebPage/WebPage.cpp
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/ios/WebPageIOS.mm