<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[181838] trunk/Source</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/181838">181838</a></dd>
<dt>Author</dt> <dd>eric.carlson@apple.com</dd>
<dt>Date</dt> <dd>2015-03-22 18:08:42 -0700 (Sun, 22 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
https://bugs.webkit.org/show_bug.cgi?id=142940

Reviewed by Sam Weinig.

Source/WebCore:

* dom/Document.cpp:
(WebCore::Document::didChoosePlaybackTarget): const-ify the didChoosePlaybackTarget argument.
* dom/Document.h:

* html/HTMLMediaSession.cpp:
(WebCore::HTMLMediaSession::didChoosePlaybackTarget): Ditto.
* html/HTMLMediaSession.h:

* page/Page.cpp:
(WebCore::Page::didChoosePlaybackTarget):  Ditto.
* page/Page.h:

* platform/audio/MediaSession.h:
* platform/graphics/MediaPlaybackTargetPickerClient.h:
* platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: 
(WebCore::MediaPlaybackTargetPickerMac::devicePicker):  Ditto.

Source/WebKit/mac:

* WebCoreSupport/WebChromeClient.h:
* WebCoreSupport/WebChromeClient.mm:
(WebChromeClient::showPlaybackTargetPicker): New.
(WebChromeClient::startingMonitoringPlaybackTargets): New.
(WebChromeClient::stopMonitoringPlaybackTargets): New.

* WebView/WebView.mm:
(-[WebView _close]): Invalidate and free the target picker.
(-[WebView _devicePicker]): New.
(-[WebView _showPlaybackTargetPicker:hasVideo:]): New.
(-[WebView _startingMonitoringPlaybackTargets]): New.
(-[WebView _stopMonitoringPlaybackTargets]): New.

* WebView/WebMediaPlaybackTargetPicker.h:
* WebView/WebMediaPlaybackTargetPicker.mm:
(WebMediaPlaybackTargetPicker::create): New.
(WebMediaPlaybackTargetPicker::WebMediaPlaybackTargetPicker): New.
(WebMediaPlaybackTargetPicker::showPlaybackTargetPicker): New.
(WebMediaPlaybackTargetPicker::startingMonitoringPlaybackTargets): New.
(WebMediaPlaybackTargetPicker::stopMonitoringPlaybackTargets): New.
(WebMediaPlaybackTargetPicker::didChoosePlaybackTarget): New.
(WebMediaPlaybackTargetPicker::externalOutputDeviceAvailableDidChange): New.
(WebMediaPlaybackTargetPicker::invalidate): New.
(WebMediaPlaybackTargetPicker::targetPicker): New.

* WebView/WebViewData.h:
(WebMediaPlaybackTargetPicker::~WebMediaPlaybackTargetPicker):
* WebView/WebViewData.mm:
* WebView/WebViewInternal.h:

Source/WebKit2:

* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::playbackTargetSelected): Argument to didChoosePlaybackTarget is now const.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDocumentcpp">trunk/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDocumenth">trunk/Source/WebCore/dom/Document.h</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaSessioncpp">trunk/Source/WebCore/html/HTMLMediaSession.cpp</a></li>
<li><a href="#trunkSourceWebCorehtmlHTMLMediaSessionh">trunk/Source/WebCore/html/HTMLMediaSession.h</a></li>
<li><a href="#trunkSourceWebCorepagePagecpp">trunk/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#trunkSourceWebCorepagePageh">trunk/Source/WebCore/page/Page.h</a></li>
<li><a href="#trunkSourceWebCoreplatformaudioMediaSessionh">trunk/Source/WebCore/platform/audio/MediaSession.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsMediaPlaybackTargetPickerClienth">trunk/Source/WebCore/platform/graphics/MediaPlaybackTargetPickerClient.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlaybackTargetPickerMacmm">trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm</a></li>
<li><a href="#trunkSourceWebKitWebKitxcodeprojprojectpbxproj">trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebKitmacChangeLog">trunk/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebChromeClienth">trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#trunkSourceWebKitmacWebCoreSupportWebChromeClientmm">trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewmm">trunk/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewDatah">trunk/Source/WebKit/mac/WebView/WebViewData.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewDatamm">trunk/Source/WebKit/mac/WebView/WebViewData.mm</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebViewInternalh">trunk/Source/WebKit/mac/WebView/WebViewInternal.h</a></li>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm">trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkSourceWebKitmacWebViewWebMediaPlaybackTargetPickerh">trunk/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.h</a></li>
<li><a href="#trunkSourceWebKitmacWebViewWebMediaPlaybackTargetPickermm">trunk/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebCore/ChangeLog        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2015-03-22  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
+        https://bugs.webkit.org/show_bug.cgi?id=142940
+
+        Reviewed by Sam Weinig.
+
+        * dom/Document.cpp:
+        (WebCore::Document::didChoosePlaybackTarget): const-ify the didChoosePlaybackTarget argument.
+        * dom/Document.h:
+
+        * html/HTMLMediaSession.cpp:
+        (WebCore::HTMLMediaSession::didChoosePlaybackTarget): Ditto.
+        * html/HTMLMediaSession.h:
+
+        * page/Page.cpp:
+        (WebCore::Page::didChoosePlaybackTarget):  Ditto.
+        * page/Page.h:
+
+        * platform/audio/MediaSession.h:
+        * platform/graphics/MediaPlaybackTargetPickerClient.h:
+        * platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm: 
+        (WebCore::MediaPlaybackTargetPickerMac::devicePicker):  Ditto.
+
</ins><span class="cx"> 2015-03-22  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         _WKWebsiteDataStore should clear WebSQL databases
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.cpp (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.cpp        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebCore/dom/Document.cpp        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -6517,7 +6517,7 @@
</span><span class="cx">         client-&gt;externalOutputDeviceAvailableDidChange(available);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Document::didChoosePlaybackTarget(MediaPlaybackTarget&amp; device)
</del><ins>+void Document::didChoosePlaybackTarget(const MediaPlaybackTarget&amp; device)
</ins><span class="cx"> {
</span><span class="cx">     MediaPlaybackTargetPickerClient* clientThatRequestedPicker = nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomDocumenth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/Document.h (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/Document.h        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebCore/dom/Document.h        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -1223,7 +1223,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="cx">     void showPlaybackTargetPicker(const HTMLMediaElement&amp;);
</span><del>-    void didChoosePlaybackTarget(MediaPlaybackTarget&amp;);
</del><ins>+    void didChoosePlaybackTarget(const MediaPlaybackTarget&amp;);
</ins><span class="cx">     void addPlaybackTargetPickerClient(MediaPlaybackTargetPickerClient&amp;);
</span><span class="cx">     void removePlaybackTargetPickerClient(MediaPlaybackTargetPickerClient&amp;);
</span><span class="cx">     bool requiresPlaybackTargetRouteMonitoring();
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaSessioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaSession.cpp (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaSession.cpp        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebCore/html/HTMLMediaSession.cpp        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -275,7 +275,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void HTMLMediaSession::didChoosePlaybackTarget(MediaPlaybackTarget&amp; device)
</del><ins>+void HTMLMediaSession::didChoosePlaybackTarget(const MediaPlaybackTarget&amp; device)
</ins><span class="cx"> {
</span><span class="cx">     m_haveRequestedPlaybackTargetPicker = false;
</span><span class="cx">     client().setWirelessPlaybackTarget(device);
</span></span></pre></div>
<a id="trunkSourceWebCorehtmlHTMLMediaSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/html/HTMLMediaSession.h (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/html/HTMLMediaSession.h        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebCore/html/HTMLMediaSession.h        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -98,7 +98,7 @@
</span><span class="cx">     void targetAvailabilityChangedTimerFired();
</span><span class="cx"> 
</span><span class="cx">     // MediaPlaybackTargetPickerClient
</span><del>-    virtual void didChoosePlaybackTarget(MediaPlaybackTarget&amp;) override;
</del><ins>+    virtual void didChoosePlaybackTarget(const MediaPlaybackTarget&amp;) override;
</ins><span class="cx">     virtual void externalOutputDeviceAvailableDidChange(bool) const override;
</span><span class="cx">     virtual bool requiresPlaybackTargetRouteMonitoring() const override;
</span><span class="cx">     virtual bool requestedPlaybackTargetPicker() const override { return m_haveRequestedPlaybackTargetPicker; }
</span></span></pre></div>
<a id="trunkSourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.cpp (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.cpp        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebCore/page/Page.cpp        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -1694,7 +1694,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void Page::didChoosePlaybackTarget(MediaPlaybackTarget&amp; target)
</del><ins>+void Page::didChoosePlaybackTarget(const MediaPlaybackTarget&amp; target)
</ins><span class="cx"> {
</span><span class="cx">     Document* documentThatRequestedPicker = nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorepagePageh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/page/Page.h (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/page/Page.h        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebCore/page/Page.h        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -430,7 +430,7 @@
</span><span class="cx">     MediaPlaybackTarget&amp; playbackTarget() const { return *m_playbackTarget.get(); }
</span><span class="cx">     void configurePlaybackTargetMonitoring();
</span><span class="cx"> 
</span><del>-    WEBCORE_EXPORT void didChoosePlaybackTarget(MediaPlaybackTarget&amp;);
</del><ins>+    WEBCORE_EXPORT void didChoosePlaybackTarget(const MediaPlaybackTarget&amp;);
</ins><span class="cx">     WEBCORE_EXPORT void playbackTargetAvailabilityDidChange(bool);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformaudioMediaSessionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/audio/MediaSession.h (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/audio/MediaSession.h        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebCore/platform/audio/MediaSession.h        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -119,7 +119,7 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="cx">     // MediaPlaybackTargetPickerClient
</span><del>-    virtual void didChoosePlaybackTarget(MediaPlaybackTarget&amp;) override { }
</del><ins>+    virtual void didChoosePlaybackTarget(const MediaPlaybackTarget&amp;) override { }
</ins><span class="cx">     virtual void externalOutputDeviceAvailableDidChange(bool) const override { }
</span><span class="cx">     virtual bool requiresPlaybackTargetRouteMonitoring() const override { return false; }
</span><span class="cx">     virtual bool requestedPlaybackTargetPicker() const override { return false; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsMediaPlaybackTargetPickerClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/MediaPlaybackTargetPickerClient.h (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/MediaPlaybackTargetPickerClient.h        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebCore/platform/graphics/MediaPlaybackTargetPickerClient.h        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -38,7 +38,7 @@
</span><span class="cx"> public:
</span><span class="cx">     virtual ~MediaPlaybackTargetPickerClient() { }
</span><span class="cx"> 
</span><del>-    virtual void didChoosePlaybackTarget(MediaPlaybackTarget&amp;) = 0;
</del><ins>+    virtual void didChoosePlaybackTarget(const MediaPlaybackTarget&amp;) = 0;
</ins><span class="cx">     virtual void externalOutputDeviceAvailableDidChange(bool) const = 0;
</span><span class="cx"> 
</span><span class="cx">     virtual bool requiresPlaybackTargetRouteMonitoring() const = 0;
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsavfoundationobjcMediaPlaybackTargetPickerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebCore/platform/graphics/avfoundation/objc/MediaPlaybackTargetPickerMac.mm        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">         [m_devicePickerMenuController addObserver:m_devicePickerMenuControllerDelegate.get() forKeyPath:externalOutputDeviceAvailableKeyName options:NSKeyValueObservingOptionNew context:nil];
</span><span class="cx">         [m_devicePickerMenuController addObserver:m_devicePickerMenuControllerDelegate.get() forKeyPath:externalOutputDevicePickedKeyName options:NSKeyValueObservingOptionNew context:nil];
</span><span class="cx"> 
</span><del>-        if (devicePicker().externalOutputDeviceAvailable)
</del><ins>+        if (m_devicePickerMenuController.get().externalOutputDeviceAvailable)
</ins><span class="cx">             availableDevicesDidChange();
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -13,6 +13,8 @@
</span><span class="cx">                 06693DDD0BFBA85200216072 /* WebInspectorClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 06693DDB0BFBA85200216072 /* WebInspectorClient.mm */; };
</span><span class="cx">                 070F549B17F1E42B00169E04 /* WebUserMediaClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 070F549917F1E42B00169E04 /* WebUserMediaClient.h */; };
</span><span class="cx">                 070F549C17F1E42B00169E04 /* WebUserMediaClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 070F549A17F1E42B00169E04 /* WebUserMediaClient.mm */; };
</span><ins>+                072E5F451ABF88750003B164 /* WebMediaPlaybackTargetPicker.h in Headers */ = {isa = PBXBuildFile; fileRef = 072E5F431ABF88750003B164 /* WebMediaPlaybackTargetPicker.h */; };
+                072E5F461ABF88750003B164 /* WebMediaPlaybackTargetPicker.mm in Sources */ = {isa = PBXBuildFile; fileRef = 072E5F441ABF88750003B164 /* WebMediaPlaybackTargetPicker.mm */; };
</ins><span class="cx">                 0AB752370FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AB752350FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h */; };
</span><span class="cx">                 0AB752380FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0AB752360FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm */; };
</span><span class="cx">                 0AEBFF630F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h in Headers */ = {isa = PBXBuildFile; fileRef = 0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="lines">@@ -476,6 +478,8 @@
</span><span class="cx">                 06693DDB0BFBA85200216072 /* WebInspectorClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebInspectorClient.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 070F549917F1E42B00169E04 /* WebUserMediaClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebUserMediaClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 070F549A17F1E42B00169E04 /* WebUserMediaClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebUserMediaClient.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                072E5F431ABF88750003B164 /* WebMediaPlaybackTargetPicker.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaPlaybackTargetPicker.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                072E5F441ABF88750003B164 /* WebMediaPlaybackTargetPicker.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebMediaPlaybackTargetPicker.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0AB752350FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapeContainerCheckContextInfo.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0AB752360FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNetscapeContainerCheckContextInfo.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0AEBFF610F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.h */ = {isa = PBXFileReference; explicitFileType = sourcecode.c.h; fileEncoding = 4; path = WebNetscapeContainerCheckPrivate.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -1336,6 +1340,8 @@
</span><span class="cx">                 9C7CABBB0190A37C0ECA16EA /* WebView */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                072E5F431ABF88750003B164 /* WebMediaPlaybackTargetPicker.h */,
+                                072E5F441ABF88750003B164 /* WebMediaPlaybackTargetPicker.mm */,
</ins><span class="cx">                                 F52CA6BD02DF9D0F018635CA /* HTML */,
</span><span class="cx">                                 51E94C0706C02CA300A9B09E /* PDF */,
</span><span class="cx">                                 A10C1D79182030190036883A /* ios */,
</span><span class="lines">@@ -1977,6 +1983,7 @@
</span><span class="cx">                                 DD7CDEE70A23BA9E00069928 /* WebTypesInternal.h in Headers */,
</span><span class="cx">                                 939810750824BF01008DF038 /* WebUIDelegate.h in Headers */,
</span><span class="cx">                                 A10C1D6B1820300E0036883A /* WebFrameIOS.h in Headers */,
</span><ins>+                                072E5F451ABF88750003B164 /* WebMediaPlaybackTargetPicker.h in Headers */,
</ins><span class="cx">                                 939810830824BF01008DF038 /* WebUIDelegatePrivate.h in Headers */,
</span><span class="cx">                                 A10C1D3418202FC50036883A /* WebGeolocationCoreLocationProvider.h in Headers */,
</span><span class="cx">                                 939810150824BF01008DF038 /* WebURLsWithTitles.h in Headers */,
</span><span class="lines">@@ -2293,6 +2300,7 @@
</span><span class="cx">                                 5185F62810712B97007AA393 /* WebNavigationData.mm in Sources */,
</span><span class="cx">                                 0AB752380FA2E4DB00D7CBB1 /* WebNetscapeContainerCheckContextInfo.mm in Sources */,
</span><span class="cx">                                 0AEBFF640F9FA8BE000D486B /* WebNetscapeContainerCheckPrivate.mm in Sources */,
</span><ins>+                                072E5F461ABF88750003B164 /* WebMediaPlaybackTargetPicker.mm in Sources */,
</ins><span class="cx">                                 1AEA66D50DC6B1FF003D12BF /* WebNetscapePluginEventHandler.mm in Sources */,
</span><span class="cx">                                 A10C1D651820300E0036883A /* WebChromeClientIOS.mm in Sources */,
</span><span class="cx">                                 A10C1D3518202FC50036883A /* WebGeolocationCoreLocationProvider.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/ChangeLog (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/ChangeLog        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebKit/mac/ChangeLog        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2015-03-22  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
+        https://bugs.webkit.org/show_bug.cgi?id=142940
+
+        Reviewed by Sam Weinig.
+
+        * WebCoreSupport/WebChromeClient.h:
+        * WebCoreSupport/WebChromeClient.mm:
+        (WebChromeClient::showPlaybackTargetPicker): New.
+        (WebChromeClient::startingMonitoringPlaybackTargets): New.
+        (WebChromeClient::stopMonitoringPlaybackTargets): New.
+
+        * WebView/WebView.mm:
+        (-[WebView _close]): Invalidate and free the target picker.
+        (-[WebView _devicePicker]): New.
+        (-[WebView _showPlaybackTargetPicker:hasVideo:]): New.
+        (-[WebView _startingMonitoringPlaybackTargets]): New.
+        (-[WebView _stopMonitoringPlaybackTargets]): New.
+
+        * WebView/WebMediaPlaybackTargetPicker.h:
+        * WebView/WebMediaPlaybackTargetPicker.mm:
+        (WebMediaPlaybackTargetPicker::create): New.
+        (WebMediaPlaybackTargetPicker::WebMediaPlaybackTargetPicker): New.
+        (WebMediaPlaybackTargetPicker::showPlaybackTargetPicker): New.
+        (WebMediaPlaybackTargetPicker::startingMonitoringPlaybackTargets): New.
+        (WebMediaPlaybackTargetPicker::stopMonitoringPlaybackTargets): New.
+        (WebMediaPlaybackTargetPicker::didChoosePlaybackTarget): New.
+        (WebMediaPlaybackTargetPicker::externalOutputDeviceAvailableDidChange): New.
+        (WebMediaPlaybackTargetPicker::invalidate): New.
+        (WebMediaPlaybackTargetPicker::targetPicker): New.
+
+        * WebView/WebViewData.h:
+        (WebMediaPlaybackTargetPicker::~WebMediaPlaybackTargetPicker):
+        * WebView/WebViewData.mm:
+        * WebView/WebViewInternal.h:
+
</ins><span class="cx"> 2015-03-19  Andy Estes  &lt;aestes@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Content Filtering] Add tests for unblock requests
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -213,6 +213,12 @@
</span><span class="cx">     WebView* webView() { return m_webView; }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+    virtual void showPlaybackTargetPicker(const WebCore::IntPoint&amp;, bool /* hasVideo */) override;
+    virtual void startingMonitoringPlaybackTargets() override;
+    virtual void stopMonitoringPlaybackTargets() override;
+#endif
+
</ins><span class="cx"> private:
</span><span class="cx">     WebView *m_webView;
</span><span class="cx"> };
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebCoreSupportWebChromeClientmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -1034,3 +1034,20 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #endif
</span><ins>+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+void WebChromeClient::showPlaybackTargetPicker(const WebCore::IntPoint&amp; location, bool hasVideo)
+{
+    [m_webView _showPlaybackTargetPicker:location hasVideo:hasVideo];
+}
+
+void WebChromeClient::startingMonitoringPlaybackTargets()
+{
+    [m_webView _startingMonitoringPlaybackTargets];
+}
+
+void WebChromeClient::stopMonitoringPlaybackTargets()
+{
+    [m_webView _stopMonitoringPlaybackTargets];
+}
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebMediaPlaybackTargetPickerh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.h (0 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.h                                (rev 0)
+++ trunk/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.h        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -0,0 +1,58 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+
+#import &lt;WebCore/MediaPlaybackTargetPicker.h&gt;
+
+namespace WebCore {
+class FloatRect;
+class Page;
+}
+
+class WebMediaPlaybackTargetPicker : public WebCore::MediaPlaybackTargetPicker::Client {
+public:
+    static std::unique_ptr&lt;WebMediaPlaybackTargetPicker&gt; create(WebCore::Page&amp;);
+
+    explicit WebMediaPlaybackTargetPicker(WebCore::Page&amp;);
+    virtual ~WebMediaPlaybackTargetPicker() { }
+
+    void showPlaybackTargetPicker(const WebCore::FloatRect&amp;, bool /* hasVideo */);
+    void startingMonitoringPlaybackTargets();
+    void stopMonitoringPlaybackTargets();
+
+    // WebCore::MediaPlaybackTargetPicker::Client
+    virtual void didChoosePlaybackTarget(const WebCore::MediaPlaybackTarget&amp;) override;
+    virtual void externalOutputDeviceAvailableDidChange(bool) override;
+
+    void invalidate();
+
+private:
+    WebCore::MediaPlaybackTargetPicker&amp; targetPicker();
+
+    WebCore::Page* m_page;
+    std::unique_ptr&lt;WebCore::MediaPlaybackTargetPicker&gt; m_targetPicker;
+};
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebMediaPlaybackTargetPickermm"></a>
<div class="addfile"><h4>Added: trunk/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.mm (0 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.mm                                (rev 0)
+++ trunk/Source/WebKit/mac/WebView/WebMediaPlaybackTargetPicker.mm        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -0,0 +1,87 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 
+ */
+
+#import &quot;WebMediaPlaybackTargetPicker.h&quot;
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+
+#import &lt;WebCore/MediaPlaybackTargetPickerMac.h&gt;
+#import &lt;WebCore/Page.h&gt;
+
+std::unique_ptr&lt;WebMediaPlaybackTargetPicker&gt; WebMediaPlaybackTargetPicker::create(WebCore::Page&amp; page)
+{
+    return std::make_unique&lt;WebMediaPlaybackTargetPicker&gt;(page);
+}
+
+WebMediaPlaybackTargetPicker::WebMediaPlaybackTargetPicker(WebCore::Page&amp; page)
+    : m_page(&amp;page)
+{
+}
+
+void WebMediaPlaybackTargetPicker::showPlaybackTargetPicker(const WebCore::FloatRect&amp; rect, bool hasVideo)
+{
+    targetPicker().showPlaybackTargetPicker(WebCore::IntRect(rect), hasVideo);
+}
+
+void WebMediaPlaybackTargetPicker::startingMonitoringPlaybackTargets()
+{
+    targetPicker().startingMonitoringPlaybackTargets();
+}
+
+void WebMediaPlaybackTargetPicker::stopMonitoringPlaybackTargets()
+{
+    targetPicker().stopMonitoringPlaybackTargets();
+}
+
+void WebMediaPlaybackTargetPicker::didChoosePlaybackTarget(const WebCore::MediaPlaybackTarget&amp; target)
+{
+    if (!m_page)
+        return;
+
+    m_page-&gt;didChoosePlaybackTarget(target);
+}
+
+void WebMediaPlaybackTargetPicker::externalOutputDeviceAvailableDidChange(bool available)
+{
+    if (!m_page)
+        return;
+
+    m_page-&gt;playbackTargetAvailabilityDidChange(available);
+}
+
+void WebMediaPlaybackTargetPicker::invalidate()
+{
+    m_page = nullptr;
+}
+
+WebCore::MediaPlaybackTargetPicker&amp; WebMediaPlaybackTargetPicker::targetPicker()
+{
+    if (!m_targetPicker)
+        m_targetPicker = WebCore::MediaPlaybackTargetPickerMac::create(*this);
+
+    return *m_targetPicker.get();
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebView.mm        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -291,6 +291,10 @@
</span><span class="cx"> #import &lt;WebCore/HIDGamepadProvider.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+#import &quot;WebMediaPlaybackTargetPicker.h&quot;
+#endif
+
</ins><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUNotificationPopoverWillClose, NSString *)
</span><span class="cx"> SOFT_LINK_CONSTANT_MAY_FAIL(Lookup, LUTermOptionDisableSearchTermIndicator, NSString *)
</span><span class="lines">@@ -1780,6 +1784,13 @@
</span><span class="cx"> 
</span><span class="cx">     [self _closePluginDatabases];
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+    if (_private-&gt;m_playbackTargetPicker) {
+        _private-&gt;m_playbackTargetPicker-&gt;invalidate();
+        _private-&gt;m_playbackTargetPicker = nullptr;
+    }
+#endif
+
</ins><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     // Need this to make leak messages accurate.
</span><span class="cx">     if (applicationIsTerminating) {
</span><span class="lines">@@ -8640,6 +8651,42 @@
</span><span class="cx"> }
</span><span class="cx"> #endif // PLATFORM(MAC)
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+- (WebMediaPlaybackTargetPicker *) _devicePicker
+{
+    if (!_private-&gt;m_playbackTargetPicker)
+        _private-&gt;m_playbackTargetPicker = WebMediaPlaybackTargetPicker::create(*_private-&gt;page);
+
+    return _private-&gt;m_playbackTargetPicker.get();
+}
+
+- (void)_showPlaybackTargetPicker:(const WebCore::IntPoint&amp;)location hasVideo:(BOOL)hasVideo
+{
+    if (!_private-&gt;page)
+        return;
+
+    NSRect rectInWindowCoordinates = [self convertRect:[self _convertRectFromRootView:CGRectMake(location.x(), location.y(), 0, 0)] toView:nil];
+    NSRect rectInScreenCoordinates = [self.window convertRectToScreen:rectInWindowCoordinates];
+    [self _devicePicker]-&gt;showPlaybackTargetPicker(rectInScreenCoordinates, hasVideo);
+}
+
+- (void)_startingMonitoringPlaybackTargets
+{
+    if (!_private-&gt;page)
+        return;
+
+    [self _devicePicker]-&gt;startingMonitoringPlaybackTargets();
+}
+
+- (void)_stopMonitoringPlaybackTargets
+{
+    if (!_private-&gt;page)
+        return;
+
+    [self _devicePicker]-&gt;stopMonitoringPlaybackTargets();
+}
+#endif
+
</ins><span class="cx"> @end
</span><span class="cx"> 
</span><span class="cx"> @implementation WebView (WebViewDeviceOrientation)
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewData.h (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewData.h        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebKit/mac/WebView/WebViewData.h        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -80,6 +80,10 @@
</span><span class="cx"> @class WebFixedPositionContent;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+class WebMediaPlaybackTargetPicker;
+#endif
+
</ins><span class="cx"> extern BOOL applicationIsTerminating;
</span><span class="cx"> extern int pluginDatabaseClientCount;
</span><span class="cx"> 
</span><span class="lines">@@ -303,5 +307,9 @@
</span><span class="cx">     RetainPtr&lt;NSData&gt; sourceApplicationAuditData;
</span><span class="cx"> 
</span><span class="cx">     BOOL _didPerformFirstNavigation;
</span><ins>+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+    std::unique_ptr&lt;WebMediaPlaybackTargetPicker&gt; m_playbackTargetPicker;
+#endif
</ins><span class="cx"> }
</span><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewDatamm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewData.mm (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewData.mm        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebKit/mac/WebView/WebViewData.mm        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -46,6 +46,10 @@
</span><span class="cx"> #import &quot;WebGeolocationProviderIOS.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+#import &quot;WebMediaPlaybackTargetPicker.h&quot;
+#endif
+
</ins><span class="cx"> BOOL applicationIsTerminating = NO;
</span><span class="cx"> int pluginDatabaseClientCount = 0;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKitmacWebViewWebViewInternalh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit/mac/WebView/WebViewInternal.h (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit/mac/WebView/WebViewInternal.h        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebKit/mac/WebView/WebViewInternal.h        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> struct DictionaryPopupInfo;
</span><ins>+class WebMediaPlaybackTargetPicker;
</ins><span class="cx"> class WebSelectionServiceController;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -268,4 +269,11 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS) &amp;&amp; defined(__cplusplus)
+- (WebMediaPlaybackTargetPicker *) _devicePicker;
+- (void)_showPlaybackTargetPicker:(const WebCore::IntPoint&amp;)location hasVideo:(BOOL)hasVideo;
+- (void)_startingMonitoringPlaybackTargets;
+- (void)_stopMonitoringPlaybackTargets;
+#endif
+
</ins><span class="cx"> @end
</span></span></pre></div>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebKit2/ChangeLog        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2015-03-22  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+        [Mac] Enable WIRELESS_PLAYBACK_TARGET for WK1
+        https://bugs.webkit.org/show_bug.cgi?id=142940
+
+        Reviewed by Sam Weinig.
+
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::playbackTargetSelected): Argument to didChoosePlaybackTarget is now const.
+
</ins><span class="cx"> 2015-03-22  Anders Carlsson  &lt;andersca@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         _WKWebsiteDataStore should clear WebSQL databases
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (181837 => 181838)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-03-22 22:50:23 UTC (rev 181837)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-03-23 01:08:42 UTC (rev 181838)
</span><span class="lines">@@ -1207,8 +1207,7 @@
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
</span><span class="cx"> void WebPage::playbackTargetSelected(const WebCore::MediaPlaybackTarget&amp; playbackTarget) const
</span><span class="cx"> {
</span><del>-    MediaPlaybackTarget nonConstTarget(playbackTarget.devicePickerContext());
-    m_page-&gt;didChoosePlaybackTarget(nonConstTarget);
</del><ins>+    m_page-&gt;didChoosePlaybackTarget(playbackTarget);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebPage::playbackTargetAvailabilityDidChange(bool changed)
</span></span></pre>
</div>
</div>

</body>
</html>