Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
authoradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Mar 2016 01:15:09 +0000 (01:15 +0000)
committeradachan@apple.com <adachan@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Mar 2016 01:15:09 +0000 (01:15 +0000)
https://bugs.webkit.org/show_bug.cgi?id=154823

Reviewed by Tim Horton.

Source/WebCore:

* Modules/mediasession/WebMediaSessionManager.cpp:
(WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
(WebCore::WebMediaSessionManager::customPlaybackActionSelected):
Call customPlaybackActionSelected() on the client that requested the picker.
* Modules/mediasession/WebMediaSessionManager.h:
* Modules/mediasession/WebMediaSessionManagerClient.h:
* dom/Document.cpp:
(WebCore::Document::showPlaybackTargetPicker):
(WebCore::Document::customPlaybackActionSelected):
* dom/Document.h:
* html/HTMLMediaElement.cpp:
(WebCore::HTMLMediaElement::customPlaybackActionSelected):
(WebCore::HTMLMediaElement::playbackTargetPickerCustomActionName):
* html/HTMLMediaElement.h:
* html/MediaElementSession.cpp:
(WebCore::MediaElementSession::showPlaybackTargetPicker):
(WebCore::MediaElementSession::customPlaybackActionSelected):
* html/MediaElementSession.h:
* page/ChromeClient.h:
* page/Page.cpp:
(WebCore::Page::showPlaybackTargetPicker):
(WebCore::Page::customPlaybackActionSelected):
* page/Page.h:
* platform/audio/PlatformMediaSession.h:
(WebCore::PlatformMediaSessionClient::customPlaybackActionSelected):
* platform/graphics/MediaPlaybackTargetClient.h:
* platform/graphics/MediaPlaybackTargetPicker.cpp:
(WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
(WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
* platform/graphics/MediaPlaybackTargetPicker.h:
(WebCore::MediaPlaybackTargetPicker::Client::customPlaybackActionSelected):
(WebCore::MediaPlaybackTargetPicker::customPlaybackActionSelected):
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
Update the forward declaration of AVOutputDeviceMenuController's showMenuForRect method.
(WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
Call the new version of showMenuForRect if available.
* platform/mac/WebVideoFullscreenInterfaceMac.h:
* platform/mac/WebVideoFullscreenInterfaceMac.mm:
(WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback):
* platform/mock/MediaPlaybackTargetPickerMock.cpp:
(WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
* platform/mock/MediaPlaybackTargetPickerMock.h:
* platform/spi/cocoa/AVKitSPI.h:
Updated with the new version of showMenuForRect.

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::showPlaybackTargetPicker):
* WebView/WebMediaPlaybackTargetPicker.h:
* WebView/WebMediaPlaybackTargetPicker.mm:
(WebMediaPlaybackTargetPicker::showPlaybackTargetPicker):
(WebMediaPlaybackTargetPicker::customPlaybackActionSelected):
* WebView/WebView.mm:
(-[WebView _showPlaybackTargetPicker:location:hasVideo:]):

Source/WebKit2:

* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showPlaybackTargetPicker):
(WebKit::WebPageProxy::customPlaybackActionSelected):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* WebProcess/WebCoreSupport/WebChromeClient.cpp:
(WebKit::WebChromeClient::showPlaybackTargetPicker):
* WebProcess/WebCoreSupport/WebChromeClient.h:
* WebProcess/WebPage/WebPage.h:
* WebProcess/WebPage/WebPage.messages.in:
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::customPlaybackActionSelected):

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

39 files changed:
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediasession/WebMediaSessionManager.cpp
Source/WebCore/Modules/mediasession/WebMediaSessionManager.h
Source/WebCore/Modules/mediasession/WebMediaSessionManagerClient.h
Source/WebCore/dom/Document.cpp
Source/WebCore/dom/Document.h
Source/WebCore/html/HTMLMediaElement.cpp
Source/WebCore/html/HTMLMediaElement.h
Source/WebCore/html/MediaElementSession.cpp
Source/WebCore/html/MediaElementSession.h
Source/WebCore/page/ChromeClient.h
Source/WebCore/page/Page.cpp
Source/WebCore/page/Page.h
Source/WebCore/platform/audio/PlatformMediaSession.h
Source/WebCore/platform/graphics/MediaPlaybackTargetClient.h
Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.cpp
Source/WebCore/platform/graphics/MediaPlaybackTargetPicker.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h
Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm
Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.h
Source/WebCore/platform/mac/WebVideoFullscreenInterfaceMac.mm
Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.cpp
Source/WebCore/platform/mock/MediaPlaybackTargetPickerMock.h
Source/WebCore/platform/spi/cocoa/AVKitSPI.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebCoreSupport/WebChromeClient.h
Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm
Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.h
Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/UIProcess/WebPageProxy.cpp
Source/WebKit2/UIProcess/WebPageProxy.h
Source/WebKit2/UIProcess/WebPageProxy.messages.in
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp
Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h
Source/WebKit2/WebProcess/WebPage/WebPage.h
Source/WebKit2/WebProcess/WebPage/WebPage.messages.in
Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm

index 3232548..0b1e550 100644 (file)
@@ -1,3 +1,56 @@
+2016-02-29  Ada Chan  <adachan@apple.com>
+
+        Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
+        https://bugs.webkit.org/show_bug.cgi?id=154823
+
+        Reviewed by Tim Horton.
+
+        * Modules/mediasession/WebMediaSessionManager.cpp:
+        (WebCore::WebMediaSessionManager::showPlaybackTargetPicker):
+        (WebCore::WebMediaSessionManager::customPlaybackActionSelected):
+        Call customPlaybackActionSelected() on the client that requested the picker.
+        * Modules/mediasession/WebMediaSessionManager.h:
+        * Modules/mediasession/WebMediaSessionManagerClient.h:
+        * dom/Document.cpp:
+        (WebCore::Document::showPlaybackTargetPicker):
+        (WebCore::Document::customPlaybackActionSelected):
+        * dom/Document.h:
+        * html/HTMLMediaElement.cpp:
+        (WebCore::HTMLMediaElement::customPlaybackActionSelected):
+        (WebCore::HTMLMediaElement::playbackTargetPickerCustomActionName):
+        * html/HTMLMediaElement.h:
+        * html/MediaElementSession.cpp:
+        (WebCore::MediaElementSession::showPlaybackTargetPicker):
+        (WebCore::MediaElementSession::customPlaybackActionSelected):
+        * html/MediaElementSession.h:
+        * page/ChromeClient.h:
+        * page/Page.cpp:
+        (WebCore::Page::showPlaybackTargetPicker):
+        (WebCore::Page::customPlaybackActionSelected):
+        * page/Page.h:
+        * platform/audio/PlatformMediaSession.h:
+        (WebCore::PlatformMediaSessionClient::customPlaybackActionSelected):
+        * platform/graphics/MediaPlaybackTargetClient.h:
+        * platform/graphics/MediaPlaybackTargetPicker.cpp:
+        (WebCore::MediaPlaybackTargetPicker::pendingActionTimerFired):
+        (WebCore::MediaPlaybackTargetPicker::showPlaybackTargetPicker):
+        * platform/graphics/MediaPlaybackTargetPicker.h:
+        (WebCore::MediaPlaybackTargetPicker::Client::customPlaybackActionSelected):
+        (WebCore::MediaPlaybackTargetPicker::customPlaybackActionSelected):
+        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.h:
+        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm:
+        Update the forward declaration of AVOutputDeviceMenuController's showMenuForRect method.
+        (WebCore::MediaPlaybackTargetPickerMac::showPlaybackTargetPicker):
+        Call the new version of showMenuForRect if available.
+        * platform/mac/WebVideoFullscreenInterfaceMac.h:
+        * platform/mac/WebVideoFullscreenInterfaceMac.mm:
+        (WebCore::WebVideoFullscreenInterfaceMac::setExternalPlayback):
+        * platform/mock/MediaPlaybackTargetPickerMock.cpp:
+        (WebCore::MediaPlaybackTargetPickerMock::showPlaybackTargetPicker):
+        * platform/mock/MediaPlaybackTargetPickerMock.h:
+        * platform/spi/cocoa/AVKitSPI.h:
+        Updated with the new version of showMenuForRect.
+
 2016-03-01  Daniel Bates  <dabates@apple.com>
 
         com.apple.WebKit.Networking.Development crashes in WebCore::formOpen()
index 7a3369f..5a58a29 100644 (file)
@@ -180,7 +180,7 @@ void WebMediaSessionManager::removeAllPlaybackTargetPickerClients(WebMediaSessio
     scheduleDelayedTask(TargetMonitoringConfigurationTask | TargetClientsConfigurationTask);
 }
 
-void WebMediaSessionManager::showPlaybackTargetPicker(WebMediaSessionManagerClient& client, uint64_t contextId, const IntRect& rect, bool)
+void WebMediaSessionManager::showPlaybackTargetPicker(WebMediaSessionManagerClient& client, uint64_t contextId, const IntRect& rect, bool, const String& customMenuItemTitle)
 {
     size_t index = find(&client, contextId);
     ASSERT(index != notFound);
@@ -195,7 +195,8 @@ void WebMediaSessionManager::showPlaybackTargetPicker(WebMediaSessionManagerClie
 
     bool hasActiveRoute = flagsAreSet(m_clientState[index]->flags, MediaProducer::IsPlayingToExternalDevice);
     LOG(Media, "WebMediaSessionManager::showPlaybackTargetPicker(%p + %llu) - hasActiveRoute = %i", &client, contextId, (int)hasActiveRoute);
-    targetPicker().showPlaybackTargetPicker(FloatRect(rect), hasActiveRoute);
+
+    targetPicker().showPlaybackTargetPicker(FloatRect(rect), hasActiveRoute, customMenuItemTitle);
 }
 
 void WebMediaSessionManager::clientStateDidChange(WebMediaSessionManagerClient& client, uint64_t contextId, MediaProducer::MediaStateFlags newFlags)
@@ -269,6 +270,17 @@ void WebMediaSessionManager::externalOutputDeviceAvailableDidChange(bool availab
         state->client.externalOutputDeviceAvailableDidChange(state->contextId, available);
 }
 
+void WebMediaSessionManager::customPlaybackActionSelected()
+{
+    for (auto& state : m_clientState) {
+        if (!state->requestedPicker)
+            continue;
+
+        state->client.customPlaybackActionSelected(state->contextId);
+        state->requestedPicker = false;
+    }
+}
+
 void WebMediaSessionManager::configureNewClients()
 {
     for (auto& state : m_clientState) {
index 0577556..be057b9 100644 (file)
@@ -55,7 +55,9 @@ public:
     WEBCORE_EXPORT uint64_t addPlaybackTargetPickerClient(WebMediaSessionManagerClient&, uint64_t);
     WEBCORE_EXPORT void removePlaybackTargetPickerClient(WebMediaSessionManagerClient&, uint64_t);
     WEBCORE_EXPORT void removeAllPlaybackTargetPickerClients(WebMediaSessionManagerClient&);
-    WEBCORE_EXPORT void showPlaybackTargetPicker(WebMediaSessionManagerClient&, uint64_t, const IntRect&, bool);
+
+    WEBCORE_EXPORT void showPlaybackTargetPicker(WebMediaSessionManagerClient&, uint64_t, const IntRect&, bool, const String&);
+
     WEBCORE_EXPORT void clientStateDidChange(WebMediaSessionManagerClient&, uint64_t, WebCore::MediaProducer::MediaStateFlags);
 
 protected:
@@ -73,6 +75,7 @@ private:
     // MediaPlaybackTargetPicker::Client
     virtual void setPlaybackTarget(Ref<WebCore::MediaPlaybackTarget>&&) override;
     virtual void externalOutputDeviceAvailableDidChange(bool) override;
+    virtual void customPlaybackActionSelected() override;
 
     size_t find(WebMediaSessionManagerClient*, uint64_t);
 
index 5974546..0ae7ff6 100644 (file)
@@ -43,6 +43,7 @@ public:
     virtual void setPlaybackTarget(uint64_t, Ref<MediaPlaybackTarget>&&) = 0;
     virtual void externalOutputDeviceAvailableDidChange(uint64_t, bool) = 0;
     virtual void setShouldPlayToPlaybackTarget(uint64_t, bool) = 0;
+    virtual void customPlaybackActionSelected(uint64_t) = 0;
 };
 
 } // namespace WebCore
index 64636d0..e2ae566 100644 (file)
@@ -6828,7 +6828,7 @@ void Document::removePlaybackTargetPickerClient(MediaPlaybackTargetClient& clien
     page->removePlaybackTargetPickerClient(clientId);
 }
 
-void Document::showPlaybackTargetPicker(MediaPlaybackTargetClient& client, bool isVideo)
+void Document::showPlaybackTargetPicker(MediaPlaybackTargetClient& client, bool isVideo, const String& customMenuItemTitle)
 {
     Page* page = this->page();
     if (!page)
@@ -6838,7 +6838,7 @@ void Document::showPlaybackTargetPicker(MediaPlaybackTargetClient& client, bool
     if (it == m_clientToIDMap.end())
         return;
 
-    page->showPlaybackTargetPicker(it->value, view()->lastKnownMousePosition(), isVideo);
+    page->showPlaybackTargetPicker(it->value, view()->lastKnownMousePosition(), isVideo, customMenuItemTitle);
 }
 
 void Document::playbackTargetPickerClientStateDidChange(MediaPlaybackTargetClient& client, MediaProducer::MediaStateFlags state)
@@ -6880,6 +6880,12 @@ void Document::setShouldPlayToPlaybackTarget(uint64_t clientId, bool shouldPlay)
 
     it->value->setShouldPlayToPlaybackTarget(shouldPlay);
 }
+
+void Document::customPlaybackActionSelected(uint64_t clientId)
+{
+    if (auto* client = m_idToClientMap.get(clientId))
+        client->customPlaybackActionSelected();
+}
 #endif // ENABLE(WIRELESS_PLAYBACK_TARGET)
 
 #if ENABLE(MEDIA_SESSION)
index f5da716..78c7669 100644 (file)
@@ -1288,12 +1288,15 @@ public:
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     void addPlaybackTargetPickerClient(MediaPlaybackTargetClient&);
     void removePlaybackTargetPickerClient(MediaPlaybackTargetClient&);
-    void showPlaybackTargetPicker(MediaPlaybackTargetClient&, bool);
+
+    void showPlaybackTargetPicker(MediaPlaybackTargetClient&, bool, const String&);
+
     void playbackTargetPickerClientStateDidChange(MediaPlaybackTargetClient&, MediaProducer::MediaStateFlags);
 
     void setPlaybackTarget(uint64_t, Ref<MediaPlaybackTarget>&&);
     void playbackTargetAvailabilityDidChange(uint64_t, bool);
     void setShouldPlayToPlaybackTarget(uint64_t, bool);
+    void customPlaybackActionSelected(uint64_t);
 #endif
 
     ShouldOpenExternalURLsPolicy shouldOpenExternalURLsPolicyToPropagate() const;
index 641ae63..f7324cf 100644 (file)
 #include <bindings/ScriptObject.h>
 #endif
 
+#if USE(APPLE_INTERNAL_SDK)
+#include <WebKitAdditions/HTMLMediaElementAdditions.cpp>
+#endif
+
 namespace WebCore {
 
 static const double SeekRepeatDelay = 0.1;
@@ -5201,6 +5205,19 @@ void HTMLMediaElement::setShouldPlayToPlaybackTarget(bool shouldPlay)
     if (m_player)
         m_player->setShouldPlayToPlaybackTarget(shouldPlay);
 }
+
+#if !USE(APPLE_INTERNAL_SDK)
+void HTMLMediaElement::customPlaybackActionSelected()
+{
+    LOG(Media, "HTMLMediaElement::customPlaybackActionSelected(%p)", this);
+}
+
+String HTMLMediaElement::playbackTargetPickerCustomActionName() const
+{
+    return { };
+}
+#endif
+
 #else // ENABLE(WIRELESS_PLAYBACK_TARGET)
 
 bool HTMLMediaElement::webkitCurrentPlaybackTargetIsWireless() const
index 48bfe0d..fe2ae27 100644 (file)
@@ -344,6 +344,8 @@ public:
     virtual bool isPlayingToWirelessPlaybackTarget() const override;
     virtual void setWirelessPlaybackTarget(Ref<MediaPlaybackTarget>&&) override;
     virtual void setShouldPlayToPlaybackTarget(bool) override;
+    virtual void customPlaybackActionSelected() override;
+    String playbackTargetPickerCustomActionName() const;
 #endif
     bool webkitCurrentPlaybackTargetIsWireless() const;
 
index 1a4de64..a4704d2 100644 (file)
@@ -35,6 +35,7 @@
 #include "Frame.h"
 #include "FrameView.h"
 #include "HTMLMediaElement.h"
+#include "HTMLMediaElementEnums.h"
 #include "HTMLNames.h"
 #include "HTMLVideoElement.h"
 #include "Logging.h"
@@ -207,7 +208,8 @@ void MediaElementSession::showPlaybackTargetPicker(const HTMLMediaElement& eleme
     }
 #endif
 
-    element.document().showPlaybackTargetPicker(*this, is<HTMLVideoElement>(element));
+    String customMenuItemTitle = element.playbackTargetPickerCustomActionName();
+    element.document().showPlaybackTargetPicker(*this, is<HTMLVideoElement>(element), customMenuItemTitle);
 }
 
 bool MediaElementSession::hasWirelessPlaybackTargets(const HTMLMediaElement&) const
@@ -331,6 +333,11 @@ void MediaElementSession::setShouldPlayToPlaybackTarget(bool shouldPlay)
     client().setShouldPlayToPlaybackTarget(shouldPlay);
 }
 
+void MediaElementSession::customPlaybackActionSelected()
+{
+    client().customPlaybackActionSelected();
+}
+
 void MediaElementSession::mediaStateDidChange(const HTMLMediaElement& element, MediaProducer::MediaStateFlags state)
 {
     element.document().playbackTargetPickerClientStateDidChange(*this, state);
index 351cb0e..56e4f2e 100644 (file)
@@ -113,6 +113,7 @@ private:
     virtual void setPlaybackTarget(Ref<MediaPlaybackTarget>&&) override;
     virtual void externalOutputDeviceAvailableDidChange(bool) override;
     virtual void setShouldPlayToPlaybackTarget(bool) override;
+    virtual void customPlaybackActionSelected() override;
 #endif
 #if PLATFORM(IOS)
     bool requiresPlaybackTargetRouteMonitoring() const override;
index 720cf09..7441e0d 100644 (file)
@@ -452,7 +452,9 @@ public:
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     virtual void addPlaybackTargetPickerClient(uint64_t /*contextId*/) { }
     virtual void removePlaybackTargetPickerClient(uint64_t /*contextId*/) { }
-    virtual void showPlaybackTargetPicker(uint64_t /*contextId*/, const WebCore::IntPoint&, bool /* isVideo */) { }
+
+    virtual void showPlaybackTargetPicker(uint64_t /*contextId*/, const WebCore::IntPoint&, bool /* isVideo */, const String& /*customMenuItemTitle*/) { }
+
     virtual void playbackTargetPickerClientStateDidChange(uint64_t /*contextId*/, MediaProducer::MediaStateFlags) { }
     virtual void setMockMediaPlaybackTargetPickerEnabled(bool)  { }
     virtual void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State) { }
index d567f51..27fc12d 100644 (file)
@@ -1853,15 +1853,16 @@ void Page::removePlaybackTargetPickerClient(uint64_t contextId)
     chrome().client().removePlaybackTargetPickerClient(contextId);
 }
 
-void Page::showPlaybackTargetPicker(uint64_t contextId, const WebCore::IntPoint& location, bool isVideo)
+void Page::showPlaybackTargetPicker(uint64_t contextId, const WebCore::IntPoint& location, bool isVideo, const String& customMenuItemTitle)
 {
 #if PLATFORM(IOS)
     // FIXME: refactor iOS implementation.
     UNUSED_PARAM(contextId);
     UNUSED_PARAM(location);
+    UNUSED_PARAM(customMenuItemTitle);
     chrome().client().showPlaybackTargetPicker(isVideo);
 #else
-    chrome().client().showPlaybackTargetPicker(contextId, location, isVideo);
+    chrome().client().showPlaybackTargetPicker(contextId, location, isVideo, customMenuItemTitle);
 #endif
 }
 
@@ -1906,6 +1907,12 @@ void Page::setShouldPlayToPlaybackTarget(uint64_t clientId, bool shouldPlay)
         frame->document()->setShouldPlayToPlaybackTarget(clientId, shouldPlay);
     }
 }
+
+void Page::customPlaybackActionSelected(uint64_t contextId)
+{
+    for (Frame* frame = &mainFrame(); frame; frame = frame->tree().traverseNext())
+        frame->document()->customPlaybackActionSelected(contextId);
+}
 #endif
 
 WheelEventTestTrigger& Page::ensureTestTrigger()
index f01d4d8..0b06d21 100644 (file)
@@ -472,7 +472,9 @@ public:
 #if ENABLE(WIRELESS_PLAYBACK_TARGET)
     void addPlaybackTargetPickerClient(uint64_t);
     void removePlaybackTargetPickerClient(uint64_t);
-    void showPlaybackTargetPicker(uint64_t, const IntPoint&, bool);
+
+    void showPlaybackTargetPicker(uint64_t, const IntPoint&, bool, const String&);
+
     void playbackTargetPickerClientStateDidChange(uint64_t, MediaProducer::MediaStateFlags);
     WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerEnabled(bool);
     WEBCORE_EXPORT void setMockMediaPlaybackTargetPickerState(const String&, MediaPlaybackTargetContext::State);
@@ -480,6 +482,7 @@ public:
     WEBCORE_EXPORT void setPlaybackTarget(uint64_t, Ref<MediaPlaybackTarget>&&);
     WEBCORE_EXPORT void playbackTargetAvailabilityDidChange(uint64_t, bool);
     WEBCORE_EXPORT void setShouldPlayToPlaybackTarget(uint64_t, bool);
+    WEBCORE_EXPORT void customPlaybackActionSelected(uint64_t);
 #endif
 
     RefPtr<WheelEventTestTrigger> testTrigger() const { return m_testTrigger; }
index 1bba6cc..c63c9b7 100644 (file)
@@ -135,6 +135,7 @@ public:
     virtual void setPlaybackTarget(Ref<MediaPlaybackTarget>&&) override { }
     virtual void externalOutputDeviceAvailableDidChange(bool) override { }
     virtual void setShouldPlayToPlaybackTarget(bool) override { }
+    virtual void customPlaybackActionSelected() override { }
 #endif
 
 #if PLATFORM(IOS)
@@ -197,6 +198,7 @@ public:
     virtual bool canPlayToWirelessPlaybackTarget() const { return false; }
     virtual bool isPlayingToWirelessPlaybackTarget() const { return false; }
     virtual void setShouldPlayToPlaybackTarget(bool) { }
+    virtual void customPlaybackActionSelected() { }
 
     virtual const Document* hostingDocument() const = 0;
 
index a30421e..067558e 100644 (file)
@@ -42,6 +42,7 @@ public:
     virtual void setPlaybackTarget(Ref<MediaPlaybackTarget>&&) = 0;
     virtual void externalOutputDeviceAvailableDidChange(bool) = 0;
     virtual void setShouldPlayToPlaybackTarget(bool) = 0;
+    virtual void customPlaybackActionSelected() = 0;
 };
 
 } // namespace WebCore
index 4931686..38aef5f 100644 (file)
@@ -59,6 +59,9 @@ void MediaPlaybackTargetPicker::pendingActionTimerFired()
 
     if (pendingActions & OutputDeviceAvailabilityChanged)
         m_client->externalOutputDeviceAvailableDidChange(externalOutputDeviceAvailable());
+
+    if (pendingActions & CustomPlaybackActionSelected)
+        m_client->customPlaybackActionSelected();
 }
 
 void MediaPlaybackTargetPicker::addPendingAction(PendingActionFlags action)
@@ -70,7 +73,7 @@ void MediaPlaybackTargetPicker::addPendingAction(PendingActionFlags action)
     m_pendingActionTimer.startOneShot(pendingActionInterval);
 }
 
-void MediaPlaybackTargetPicker::showPlaybackTargetPicker(const FloatRect&, bool)
+void MediaPlaybackTargetPicker::showPlaybackTargetPicker(const FloatRect&, bool, const String&)
 {
     ASSERT_NOT_REACHED();
 }
index afe0bd3..553472d 100644 (file)
@@ -45,19 +45,21 @@ public:
     public:
         virtual void setPlaybackTarget(Ref<MediaPlaybackTarget>&&) = 0;
         virtual void externalOutputDeviceAvailableDidChange(bool) = 0;
+        virtual void customPlaybackActionSelected() { }
 
         void invalidate();
     };
 
     virtual ~MediaPlaybackTargetPicker();
 
-    virtual void showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute);
+    virtual void showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute, const String&);
     virtual void startingMonitoringPlaybackTargets();
     virtual void stopMonitoringPlaybackTargets();
     virtual void invalidatePlaybackTargets();
 
     void availableDevicesDidChange() { addPendingAction(OutputDeviceAvailabilityChanged); }
     void currentDeviceDidChange() { addPendingAction(CurrentDeviceDidChange); }
+    void customPlaybackActionSelected() { addPendingAction(CustomPlaybackActionSelected); }
 
 protected:
     explicit MediaPlaybackTargetPicker(Client&);
@@ -65,6 +67,7 @@ protected:
     enum ActionType {
         OutputDeviceAvailabilityChanged = 1 << 0,
         CurrentDeviceDidChange = 1 << 1,
+        CustomPlaybackActionSelected = 1 << 2,
     };
     typedef unsigned PendingActionFlags;
 
index 9a13869..63f5d30 100644 (file)
@@ -43,7 +43,8 @@ public:
 
     virtual ~MediaPlaybackTargetPickerMac();
 
-    void showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute) override;
+    virtual void showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute, const String&) override;
+
     void startingMonitoringPlaybackTargets() override;
     void stopMonitoringPlaybackTargets() override;
     void invalidatePlaybackTargets() override;
index 10aaa50..ab7ff4b 100644 (file)
@@ -51,11 +51,6 @@ using namespace WebCore;
 static NSString *externalOutputDeviceAvailableKeyName = @"externalOutputDeviceAvailable";
 static NSString *externalOutputDevicePickedKeyName = @"externalOutputDevicePicked";
 
-// FIXME: remove this once the headers are available.
-@interface AVOutputDeviceMenuController (ForwardDeclaration)
-- (BOOL)showMenuForRect:(NSRect)screenRect appearanceName:(NSString *)appearanceName allowReselectionOfSelectedOutputDevice:(BOOL)allowReselectionOfSelectedOutputDevice;
-@end
-
 @interface WebAVOutputDeviceMenuControllerHelper : NSObject {
     MediaPlaybackTargetPickerMac* m_callback;
 }
@@ -114,7 +109,7 @@ AVOutputDeviceMenuControllerType *MediaPlaybackTargetPickerMac::devicePicker()
     return m_outputDeviceMenuController.get();
 }
 
-void MediaPlaybackTargetPickerMac::showPlaybackTargetPicker(const FloatRect& location, bool checkActiveRoute)
+void MediaPlaybackTargetPickerMac::showPlaybackTargetPicker(const FloatRect& location, bool checkActiveRoute, const String& customMenuItemTitle)
 {
     if (!client() || m_showingMenu)
         return;
@@ -122,14 +117,29 @@ void MediaPlaybackTargetPickerMac::showPlaybackTargetPicker(const FloatRect& loc
     LOG(Media, "MediaPlaybackTargetPickerMac::showPlaybackTargetPicker - checkActiveRoute = %i", (int)checkActiveRoute);
 
     AVOutputDeviceMenuControllerType *picker = devicePicker();
-    if (![picker respondsToSelector:@selector(showMenuForRect:appearanceName:allowReselectionOfSelectedOutputDevice:)])
+    if (![picker respondsToSelector:@selector(showMenuForRect:appearanceName:allowReselectionOfSelectedOutputDevice:customMenuItemTitle:customMenuItemEnabled:)] && ![picker respondsToSelector:@selector(showMenuForRect:appearanceName:allowReselectionOfSelectedOutputDevice:)])
         return;
 
     m_showingMenu = true;
-    if ([picker showMenuForRect:location appearanceName:NSAppearanceNameVibrantLight allowReselectionOfSelectedOutputDevice:!checkActiveRoute]) {
+
+    if ([picker respondsToSelector:@selector(showMenuForRect:appearanceName:allowReselectionOfSelectedOutputDevice:customMenuItemTitle:customMenuItemEnabled:)]) {
+        NSString *customMenuItemTitleNSString = customMenuItemTitle.isEmpty() ? nil : (NSString *)customMenuItemTitle;
+        switch ([picker showMenuForRect:location appearanceName:NSAppearanceNameVibrantLight allowReselectionOfSelectedOutputDevice:!checkActiveRoute customMenuItemTitle:customMenuItemTitleNSString customMenuItemEnabled:YES]) {
+        case AVOutputDeviceMenuControllerSelectionCustomMenuItem:
+            customPlaybackActionSelected();
+            break;
+        case AVOutputDeviceMenuControllerSelectionOutputDevice:
+            if (!checkActiveRoute)
+                currentDeviceDidChange();
+            break;
+        case AVOutputDeviceMenuControllerSelectionNone:
+            break;
+        }
+    } else if ([picker showMenuForRect:location appearanceName:NSAppearanceNameVibrantLight allowReselectionOfSelectedOutputDevice:!checkActiveRoute]) {
         if (!checkActiveRoute)
             currentDeviceDidChange();
     }
+
     m_showingMenu = false;
 }
 
index 685a67b..c4c24d0 100644 (file)
@@ -70,7 +70,7 @@ public:
     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 setExternalPlayback(bool enabled, ExternalPlaybackTargetType, WTF::String localizedDeviceName) override;
     WEBCORE_EXPORT void setWirelessVideoPlaybackDisabled(bool) override { }
 
     WEBCORE_EXPORT void setupFullscreen(NSView& layerHostedView, const IntRect& initialRect, NSWindow *parentWindow, HTMLMediaElementEnums::VideoFullscreenMode, bool allowsPictureInPicturePlayback);
index 1faec25..52a672f 100644 (file)
@@ -99,6 +99,10 @@ void WebVideoFullscreenInterfaceMac::preparedToReturnToInline(bool, const IntRec
 {
 }
 
+void WebVideoFullscreenInterfaceMac::setExternalPlayback(bool, ExternalPlaybackTargetType, WTF::String)
+{
+}
+
 bool supportsPictureInPicture()
 {
     return false;
index 774259d..76b6a02 100644 (file)
@@ -70,7 +70,7 @@ void MediaPlaybackTargetPickerMock::timerFired()
     currentDeviceDidChange();
 }
 
-void MediaPlaybackTargetPickerMock::showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute)
+void MediaPlaybackTargetPickerMock::showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute, const String&)
 {
     if (!client() || m_showingMenu)
         return;
index 35cc954..eae63b7 100644 (file)
@@ -41,7 +41,7 @@ public:
 
     virtual ~MediaPlaybackTargetPickerMock();
 
-    void showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute) override;
+    void showPlaybackTargetPicker(const FloatRect&, bool checkActiveRoute, const String&) override;
     void startingMonitoringPlaybackTargets() override;
     void stopMonitoringPlaybackTargets() override;
     void invalidatePlaybackTargets() override;
index bbc2ce2..42dbe66 100644 (file)
@@ -134,6 +134,13 @@ NS_CLASS_AVAILABLE_MAC(10_11)
 - (void)showMenuForRect:(NSRect)screenRect appearanceName:(NSString *)appearanceName;
 - (BOOL)showMenuForRect:(NSRect)screenRect appearanceName:(NSString *)appearanceName allowReselectionOfSelectedOutputDevice:(BOOL)allowReselectionOfSelectedOutputDevice;
 
+typedef NS_ENUM(NSInteger, AVOutputDeviceMenuControllerSelection) {
+    AVOutputDeviceMenuControllerSelectionOutputDevice,
+    AVOutputDeviceMenuControllerSelectionCustomMenuItem,
+    AVOutputDeviceMenuControllerSelectionNone
+};
+
+- (AVOutputDeviceMenuControllerSelection)showMenuForRect:(NSRect)screenRect appearanceName:(NSString *)appearanceName allowReselectionOfSelectedOutputDevice:(BOOL)allowReselectionOfSelectedOutputDevice customMenuItemTitle:(NSString *)customMenuItemTitle customMenuItemEnabled:(BOOL)customMenuItemEnabled;
 @end
 
 
index b7131cb..627e7f4 100644 (file)
@@ -1,3 +1,20 @@
+2016-02-29  Ada Chan  <adachan@apple.com>
+
+        Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
+        https://bugs.webkit.org/show_bug.cgi?id=154823
+
+        Reviewed by Tim Horton.
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::showPlaybackTargetPicker):
+        * WebView/WebMediaPlaybackTargetPicker.h:
+        * WebView/WebMediaPlaybackTargetPicker.mm:
+        (WebMediaPlaybackTargetPicker::showPlaybackTargetPicker):
+        (WebMediaPlaybackTargetPicker::customPlaybackActionSelected):
+        * WebView/WebView.mm:
+        (-[WebView _showPlaybackTargetPicker:location:hasVideo:]):
+
 2016-03-01  Tim Horton  <timothy_horton@apple.com>
 
         Expose MediaElement and VideoElement to the Objective-C DOM bindings
index 20c06e9..83b1c32 100644 (file)
@@ -213,7 +213,7 @@ public:
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
     void addPlaybackTargetPickerClient(uint64_t /*contextId*/) override;
     void removePlaybackTargetPickerClient(uint64_t /*contextId*/) override;
-    void showPlaybackTargetPicker(uint64_t /*contextId*/, const WebCore::IntPoint&, bool /* hasVideo */) override;
+    void showPlaybackTargetPicker(uint64_t /*contextId*/, const WebCore::IntPoint&, bool /* hasVideo */, const String&) override;
     void playbackTargetPickerClientStateDidChange(uint64_t /*contextId*/, WebCore::MediaProducer::MediaStateFlags) override;
     void setMockMediaPlaybackTargetPickerEnabled(bool) override;
     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State) override;
index 0c85940..a22b94e 100644 (file)
@@ -1032,7 +1032,7 @@ void WebChromeClient::removePlaybackTargetPickerClient(uint64_t contextId)
     [m_webView _removePlaybackTargetPickerClient:contextId];
 }
 
-void WebChromeClient::showPlaybackTargetPicker(uint64_t contextId, const WebCore::IntPoint& location, bool hasVideo)
+void WebChromeClient::showPlaybackTargetPicker(uint64_t contextId, const WebCore::IntPoint& location, bool hasVideo, const String&)
 {
     [m_webView _showPlaybackTargetPicker:contextId location:location hasVideo:hasVideo];
 }
index dd1ed2c..8e542f8 100644 (file)
@@ -45,7 +45,7 @@ public:
 
     void addPlaybackTargetPickerClient(uint64_t);
     void removePlaybackTargetPickerClient(uint64_t);
-    void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
+    void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo, const String&);
     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
     void setMockMediaPlaybackTargetPickerEnabled(bool);
     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
@@ -54,6 +54,7 @@ public:
     virtual void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
     virtual void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
     virtual void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
+    virtual void customPlaybackActionSelected(uint64_t) override;
 
     void invalidate();
 
index 6d8cbf5..ecbf70f 100644 (file)
@@ -51,9 +51,9 @@ void WebMediaPlaybackTargetPicker::removePlaybackTargetPickerClient(uint64_t con
     WebCore::WebMediaSessionManager::shared().removePlaybackTargetPickerClient(*this, contextId);
 }
 
-void WebMediaPlaybackTargetPicker::showPlaybackTargetPicker(uint64_t contextId, const WebCore::FloatRect& rect, bool hasVideo)
+void WebMediaPlaybackTargetPicker::showPlaybackTargetPicker(uint64_t contextId, const WebCore::FloatRect& rect, bool hasVideo, const String& customMenuItemTitle)
 {
-    WebCore::WebMediaSessionManager::shared().showPlaybackTargetPicker(*this, contextId, WebCore::IntRect(rect), hasVideo);
+    WebCore::WebMediaSessionManager::shared().showPlaybackTargetPicker(*this, contextId, WebCore::IntRect(rect), hasVideo, customMenuItemTitle);
 }
 
 void WebMediaPlaybackTargetPicker::playbackTargetPickerClientStateDidChange(uint64_t contextId, WebCore::MediaProducer::MediaStateFlags state)
@@ -95,6 +95,14 @@ void WebMediaPlaybackTargetPicker::setShouldPlayToPlaybackTarget(uint64_t contex
     m_page->setShouldPlayToPlaybackTarget(contextId, shouldPlay);
 }
 
+void WebMediaPlaybackTargetPicker::customPlaybackActionSelected(uint64_t contextId)
+{
+    if (!m_page)
+        return;
+
+    m_page->customPlaybackActionSelected(contextId);
+}
+
 void WebMediaPlaybackTargetPicker::invalidate()
 {
     m_page = nullptr;
index 1f11bef..7789f7d 100644 (file)
@@ -8739,7 +8739,7 @@ bool LayerFlushController::flushLayers()
         return;
 
     NSRect rectInScreenCoordinates = [self.window convertRectToScreen:NSMakeRect(location.x(), location.y(), 0, 0)];
-    [self _devicePicker]->showPlaybackTargetPicker(clientId, rectInScreenCoordinates, hasVideo);
+    [self _devicePicker]->showPlaybackTargetPicker(clientId, rectInScreenCoordinates, hasVideo, { });
 }
 
 - (void)_playbackTargetPickerClientStateDidChange:(uint64_t)clientId state:(WebCore::MediaProducer::MediaStateFlags)state
index dd8d344..e94e925 100644 (file)
@@ -1,3 +1,23 @@
+2016-02-29  Ada Chan  <adachan@apple.com>
+
+        Adopt the new version of AVOutputDeviceMenuController's showMenuForRect method.
+        https://bugs.webkit.org/show_bug.cgi?id=154823
+
+        Reviewed by Tim Horton.
+
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::showPlaybackTargetPicker):
+        (WebKit::WebPageProxy::customPlaybackActionSelected):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+        (WebKit::WebChromeClient::showPlaybackTargetPicker):
+        * WebProcess/WebCoreSupport/WebChromeClient.h:
+        * WebProcess/WebPage/WebPage.h:
+        * WebProcess/WebPage/WebPage.messages.in:
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::customPlaybackActionSelected):
+
 2016-02-29  Brent Fulgham  <bfulgham@apple.com>
 
         [WK2] Stub support for WebsiteDataTypeResourceLoadStatistics
index 7ffb46b..32fe340 100644 (file)
@@ -6106,9 +6106,9 @@ void WebPageProxy::removePlaybackTargetPickerClient(uint64_t contextId)
     m_pageClient.mediaSessionManager().removePlaybackTargetPickerClient(*this, contextId);
 }
 
-void WebPageProxy::showPlaybackTargetPicker(uint64_t contextId, const WebCore::FloatRect& rect, bool hasVideo)
+void WebPageProxy::showPlaybackTargetPicker(uint64_t contextId, const WebCore::FloatRect& rect, bool hasVideo, const String& customMenuItemTitle)
 {
-    m_pageClient.mediaSessionManager().showPlaybackTargetPicker(*this, contextId, m_pageClient.rootViewToScreen(IntRect(rect)), hasVideo);
+    m_pageClient.mediaSessionManager().showPlaybackTargetPicker(*this, contextId, m_pageClient.rootViewToScreen(IntRect(rect)), hasVideo, customMenuItemTitle);
 }
 
 void WebPageProxy::playbackTargetPickerClientStateDidChange(uint64_t contextId, WebCore::MediaProducer::MediaStateFlags state)
@@ -6149,6 +6149,14 @@ void WebPageProxy::setShouldPlayToPlaybackTarget(uint64_t contextId, bool should
 
     m_process->send(Messages::WebPage::SetShouldPlayToPlaybackTarget(contextId, shouldPlay), m_pageID);
 }
+
+void WebPageProxy::customPlaybackActionSelected(uint64_t contextId)
+{
+    if (!isValid())
+        return;
+
+    m_process->send(Messages::WebPage::CustomPlaybackActionSelected(contextId), m_pageID);
+}
 #endif
 
 void WebPageProxy::didChangeBackgroundColor()
index be7c644..5fb259f 100644 (file)
@@ -1062,7 +1062,7 @@ public:
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
     void addPlaybackTargetPickerClient(uint64_t);
     void removePlaybackTargetPickerClient(uint64_t);
-    void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo);
+    void showPlaybackTargetPicker(uint64_t, const WebCore::FloatRect&, bool hasVideo, const String&);
     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags);
     void setMockMediaPlaybackTargetPickerEnabled(bool);
     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State);
@@ -1071,6 +1071,7 @@ public:
     virtual void setPlaybackTarget(uint64_t, Ref<WebCore::MediaPlaybackTarget>&&) override;
     virtual void externalOutputDeviceAvailableDidChange(uint64_t, bool) override;
     virtual void setShouldPlayToPlaybackTarget(uint64_t, bool) override;
+    virtual void customPlaybackActionSelected(uint64_t) override;
 #endif
 
     void didChangeBackgroundColor();
index 14e50f9..1fc4684 100644 (file)
@@ -435,7 +435,7 @@ messages -> WebPageProxy {
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
     AddPlaybackTargetPickerClient(uint64_t contextId)
     RemovePlaybackTargetPickerClient(uint64_t contextId)
-    ShowPlaybackTargetPicker(uint64_t clientId, WebCore::FloatRect pickerLocation, bool hasVideo)
+    ShowPlaybackTargetPicker(uint64_t clientId, WebCore::FloatRect pickerLocation, bool hasVideo, String customMenuItemTitle)
     PlaybackTargetPickerClientStateDidChange(uint64_t contextId, unsigned mediaState)
     SetMockMediaPlaybackTargetPickerEnabled(bool enabled)
     SetMockMediaPlaybackTargetPickerState(String name, unsigned pickerState)
index bf57cbf..d1b9859 100644 (file)
@@ -1092,11 +1092,11 @@ void WebChromeClient::removePlaybackTargetPickerClient(uint64_t contextId)
 }
 
 
-void WebChromeClient::showPlaybackTargetPicker(uint64_t contextId, const WebCore::IntPoint& position, bool isVideo)
+void WebChromeClient::showPlaybackTargetPicker(uint64_t contextId, const WebCore::IntPoint& position, bool isVideo, const String& customMenuItemTitle)
 {
     FrameView* frameView = m_page->mainFrame()->view();
     FloatRect rect(frameView->contentsToRootView(frameView->windowToContents(position)), FloatSize());
-    m_page->send(Messages::WebPageProxy::ShowPlaybackTargetPicker(contextId, rect, isVideo));
+    m_page->send(Messages::WebPageProxy::ShowPlaybackTargetPicker(contextId, rect, isVideo, customMenuItemTitle));
 }
 
 void WebChromeClient::playbackTargetPickerClientStateDidChange(uint64_t contextId, WebCore::MediaProducer::MediaStateFlags state)
index 7641303..2ad27ef 100644 (file)
@@ -317,7 +317,7 @@ private:
 #if ENABLE(WIRELESS_PLAYBACK_TARGET) && !PLATFORM(IOS)
     void addPlaybackTargetPickerClient(uint64_t /*contextId*/) override;
     void removePlaybackTargetPickerClient(uint64_t /*contextId*/) override;
-    void showPlaybackTargetPicker(uint64_t contextId, const WebCore::IntPoint&, bool) override;
+    void showPlaybackTargetPicker(uint64_t /*contextId*/, const WebCore::IntPoint&, bool, const String&) override;
     void playbackTargetPickerClientStateDidChange(uint64_t, WebCore::MediaProducer::MediaStateFlags) override;
     void setMockMediaPlaybackTargetPickerEnabled(bool) override;
     void setMockMediaPlaybackTargetPickerState(const String&, WebCore::MediaPlaybackTargetContext::State) override;
index 5feba08..965554d 100644 (file)
@@ -1168,6 +1168,7 @@ private:
     void playbackTargetSelected(uint64_t, const WebCore::MediaPlaybackTargetContext& outputDevice) const;
     void playbackTargetAvailabilityDidChange(uint64_t, bool);
     void setShouldPlayToPlaybackTarget(uint64_t, bool);
+    void customPlaybackActionSelected(uint64_t);
 #endif
 
     void clearWheelEventTestTrigger();
index 90e8102..5643e18 100644 (file)
@@ -414,6 +414,7 @@ messages -> WebPage LegacyReceiver {
     PlaybackTargetSelected(uint64_t contextId, WebCore::MediaPlaybackTargetContext target)
     PlaybackTargetAvailabilityDidChange(uint64_t contextId, bool available)
     SetShouldPlayToPlaybackTarget(uint64_t contextId, bool shouldPlay)
+    CustomPlaybackActionSelected(uint64_t contextId)
 #endif
 
     ClearWheelEventTestTrigger()
index 5825c26..bf1751b 100644 (file)
@@ -1159,6 +1159,11 @@ void WebPage::setShouldPlayToPlaybackTarget(uint64_t contextId, bool shouldPlay)
 {
     m_page->setShouldPlayToPlaybackTarget(contextId, shouldPlay);
 }
+
+void WebPage::customPlaybackActionSelected(uint64_t contextId)
+{
+    m_page->customPlaybackActionSelected(contextId);
+}
 #endif