<!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>[181444] tags/Safari-601.1.22/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/181444">181444</a></dd>
<dt>Author</dt> <dd>bshafiei@apple.com</dd>
<dt>Date</dt> <dd>2015-03-12 10:41:25 -0700 (Thu, 12 Mar 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/181442">r181442</a>.  rdar://problem/11903887</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#tagsSafari601122SourceWebCoreChangeLog">tags/Safari-601.1.22/Source/WebCore/ChangeLog</a></li>
<li><a href="#tagsSafari601122SourceWebCoredomDocumentcpp">tags/Safari-601.1.22/Source/WebCore/dom/Document.cpp</a></li>
<li><a href="#tagsSafari601122SourceWebCorepageChromeClienth">tags/Safari-601.1.22/Source/WebCore/page/ChromeClient.h</a></li>
<li><a href="#tagsSafari601122SourceWebCorepagePagecpp">tags/Safari-601.1.22/Source/WebCore/page/Page.cpp</a></li>
<li><a href="#tagsSafari601122SourceWebKit2ChangeLog">tags/Safari-601.1.22/Source/WebKit2/ChangeLog</a></li>
<li><a href="#tagsSafari601122SourceWebKit2SharedmacWebCoreArgumentCodersMacmm">tags/Safari-601.1.22/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm</a></li>
<li><a href="#tagsSafari601122SourceWebKit2UIProcessWebMediaPlaybackTargetPickerProxycpp">tags/Safari-601.1.22/Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp</a></li>
<li><a href="#tagsSafari601122SourceWebKit2UIProcessmacPageClientImplh">tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/PageClientImpl.h</a></li>
<li><a href="#tagsSafari601122SourceWebKit2UIProcessmacPageClientImplmm">tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/PageClientImpl.mm</a></li>
<li><a href="#tagsSafari601122SourceWebKit2WebKit2xcodeprojprojectpbxproj">tags/Safari-601.1.22/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj</a></li>
<li><a href="#tagsSafari601122SourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp">tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp</a></li>
<li><a href="#tagsSafari601122SourceWebKit2WebProcessWebCoreSupportWebChromeClienth">tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#tagsSafari601122SourceWebKit2WebProcessWebPageWebPageh">tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/WebPage.h</a></li>
<li><a href="#tagsSafari601122SourceWebKit2WebProcessWebPageWebPagemessagesin">tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in</a></li>
<li><a href="#tagsSafari601122SourceWebKit2WebProcessWebPagemacWebPageMacmm">tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
<li><a href="#tagsSafari601122SourceWebKit2WebProcesscomappleWebProcesssbin">tags/Safari-601.1.22/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#tagsSafari601122SourceWebKit2UIProcessmacWebMediaPlaybackTargetPickerProxyMach">tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h</a></li>
<li><a href="#tagsSafari601122SourceWebKit2UIProcessmacWebMediaPlaybackTargetPickerProxyMacmm">tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="tagsSafari601122SourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebCore/ChangeLog (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebCore/ChangeLog        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebCore/ChangeLog        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2015-03-12  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
+        Merge r181442.
+
+    2015-03-12  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+            [Mac] Update AirPlay handling
+            https://bugs.webkit.org/show_bug.cgi?id=142541
+
+            Unreviewed, respond to post-review comments.
+
+            * dom/Document.cpp:
+            (WebCore::Document::didChoosePlaybackTarget):
+            * page/ChromeClient.h:
+            * page/Page.cpp:
+            (WebCore::Page::showPlaybackTargetPicker):
+            (WebCore::Page::didChoosePlaybackTarget):
+            (WebCore::Page::configurePlaybackTargetMonitoring):
+
</ins><span class="cx"> 2015-03-11  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r181423.
</span></span></pre></div>
<a id="tagsSafari601122SourceWebCoredomDocumentcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebCore/dom/Document.cpp (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebCore/dom/Document.cpp        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebCore/dom/Document.cpp        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -6430,6 +6430,9 @@
</span><span class="cx">         client-&gt;didChoosePlaybackTarget(device);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // Notify the client that requested the chooser last because if more than one
+    // is playing, only the last one to set the context will actually get to play
+    //  to the external device.
</ins><span class="cx">     if (clientThatRequestedPicker)
</span><span class="cx">         clientThatRequestedPicker-&gt;didChoosePlaybackTarget(device);
</span><span class="cx"> }
</span></span></pre></div>
<a id="tagsSafari601122SourceWebCorepageChromeClienth"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebCore/page/ChromeClient.h (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebCore/page/ChromeClient.h        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebCore/page/ChromeClient.h        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -446,7 +446,7 @@
</span><span class="cx">     virtual bool shouldDispatchFakeMouseMoveEvents() const { return true; }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><del>-    virtual void showPlaybackTargetPicker(const WebCore::IntPoint&amp;, bool) { }
</del><ins>+    virtual void showPlaybackTargetPicker(const WebCore::IntPoint&amp;, bool /* isVideo */) { }
</ins><span class="cx">     virtual void startingMonitoringPlaybackTargets() { }
</span><span class="cx">     virtual void stopMonitoringPlaybackTargets() { }
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="tagsSafari601122SourceWebCorepagePagecpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebCore/page/Page.cpp (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebCore/page/Page.cpp        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebCore/page/Page.cpp        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -1700,8 +1700,8 @@
</span><span class="cx"> #if ENABLE(WIRELESS_PLAYBACK_TARGET)
</span><span class="cx"> void Page::showPlaybackTargetPicker(Document* document, const WebCore::IntPoint&amp; location, bool isVideo)
</span><span class="cx"> {
</span><ins>+    m_documentRequestingPlaybackTargetPicker = document;
</ins><span class="cx"> 
</span><del>-    m_documentRequestingPlaybackTargetPicker = document;
</del><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx">     // FIXME: refactor iOS implementation.
</span><span class="cx">     UNUSED_PARAM(location);
</span><span class="lines">@@ -1725,6 +1725,9 @@
</span><span class="cx">         frame-&gt;document()-&gt;didChoosePlaybackTarget(target);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    // Notify the document that requested the chooser last because if more than one element
+    // is playing the last one to set the context will be the one that actually gets to
+    //  play to the external device.
</ins><span class="cx">     if (documentThatRequestedPicker)
</span><span class="cx">         documentThatRequestedPicker-&gt;didChoosePlaybackTarget(target);
</span><span class="cx"> 
</span><span class="lines">@@ -1752,7 +1755,6 @@
</span><span class="cx">         return;
</span><span class="cx">     m_requiresPlaybackTargetMonitoring = monitoringRequired;
</span><span class="cx"> 
</span><del>-
</del><span class="cx">     if (monitoringRequired)
</span><span class="cx">         chrome().client().startingMonitoringPlaybackTargets();
</span><span class="cx">     else
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/ChangeLog (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/ChangeLog        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/ChangeLog        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -1,3 +1,31 @@
</span><ins>+2015-03-12  Babak Shafiei  &lt;bshafiei@apple.com&gt;
+
+        Merge r181442.
+
+    2015-03-12  Eric Carlson  &lt;eric.carlson@apple.com&gt;
+
+            [Mac] Update AirPlay handling
+            https://bugs.webkit.org/show_bug.cgi?id=142541
+
+            Unreviewed, respond to post-review comments and add previously reviewed changes
+            missed by a bungled merge.
+
+            * Shared/mac/WebCoreArgumentCodersMac.mm:
+            * UIProcess/WebMediaPlaybackTargetPickerProxy.cpp:
+            (WebKit::WebMediaPlaybackTargetPickerProxy::~WebMediaPlaybackTargetPickerProxy):
+            * UIProcess/mac/PageClientImpl.h:
+            * UIProcess/mac/PageClientImpl.mm:
+            (WebKit::PageClientImpl::createPlaybackTargetPicker):
+            * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h: Added.
+            * UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm: Added.
+            * WebKit2.xcodeproj/project.pbxproj:
+            * WebProcess/WebCoreSupport/WebChromeClient.cpp:
+            * WebProcess/WebCoreSupport/WebChromeClient.h:
+            * WebProcess/WebPage/WebPage.h:
+            * WebProcess/WebPage/WebPage.messages.in:
+            * WebProcess/WebPage/mac/WebPageMac.mm:
+            * WebProcess/com.apple.WebProcess.sb.in:
+
</ins><span class="cx"> 2015-03-11  Babak Shafiei  &lt;bshafiei@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Merge r181423.
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2SharedmacWebCoreArgumentCodersMacmm"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/Shared/mac/WebCoreArgumentCodersMac.mm        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -38,8 +38,6 @@
</span><span class="cx"> #import &lt;WebCore/ProtectionSpace.h&gt;
</span><span class="cx"> #import &lt;WebCore/ResourceError.h&gt;
</span><span class="cx"> #import &lt;WebCore/ResourceRequest.h&gt;
</span><del>-#import &lt;WebCore/SoftLinking.h&gt;
-#import &lt;objc/runtime.h&gt;
</del><span class="cx"> 
</span><span class="cx"> #if USE(CFNETWORK)
</span><span class="cx"> #import &lt;CFNetwork/CFURLRequest.h&gt;
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2UIProcessWebMediaPlaybackTargetPickerProxycpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/UIProcess/WebMediaPlaybackTargetPickerProxy.cpp        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -37,7 +37,7 @@
</span><span class="cx"> 
</span><span class="cx"> WebMediaPlaybackTargetPickerProxy::~WebMediaPlaybackTargetPickerProxy()
</span><span class="cx"> {
</span><del>-    m_client = 0;
</del><ins>+    m_client = nullptr;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void WebMediaPlaybackTargetPickerProxy::showPlaybackTargetPicker(const WebCore::FloatRect&amp;, bool)
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2UIProcessmacPageClientImplh"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/PageClientImpl.h (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/PageClientImpl.h        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -204,6 +204,10 @@
</span><span class="cx"> #if USE(DICTATION_ALTERNATIVES)
</span><span class="cx">     std::unique_ptr&lt;WebCore::AlternativeTextUIController&gt; m_alternativeTextUIController;
</span><span class="cx"> #endif
</span><ins>+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+    virtual std::unique_ptr&lt;WebMediaPlaybackTargetPickerProxy&gt; createPlaybackTargetPicker(WebPageProxy*) override;
+#endif
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2UIProcessmacPageClientImplmm"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/PageClientImpl.mm (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/PageClientImpl.mm        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -70,6 +70,10 @@
</span><span class="cx"> #import &lt;AppKit/NSTextAlternatives.h&gt;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+#include &quot;WebMediaPlaybackTargetPickerProxyMac.h&quot;
+#endif
+
</ins><span class="cx"> @interface NSApplication (WebNSApplicationDetails)
</span><span class="cx"> - (NSCursor *)_cursorRectCursor;
</span><span class="cx"> @end
</span><span class="lines">@@ -788,6 +792,12 @@
</span><span class="cx">     [menu popUpMenuPositioningItem:nil atLocation:location inView:m_wkView];
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+std::unique_ptr&lt;WebMediaPlaybackTargetPickerProxy&gt; PageClientImpl::createPlaybackTargetPicker(WebPageProxy* page)
+{
+    return WebMediaPlaybackTargetPickerProxyMac::create(*page);
+}
+#endif
</ins><span class="cx"> 
</span><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2UIProcessmacWebMediaPlaybackTargetPickerProxyMachfromrev181442trunkSourceWebKit2UIProcessmacWebMediaPlaybackTargetPickerProxyMach"></a>
<div class="copfile"><h4>Copied: tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h (from rev 181442, trunk/Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h) (0 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h                                (rev 0)
+++ tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.h        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -0,0 +1,69 @@
</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. AND ITS CONTRIBUTORS ``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 ITS 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.
+ */
+
+#ifndef WebMediaPlaybackTargetPickerProxyMac_h
+#define WebMediaPlaybackTargetPickerProxyMac_h
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+
+#import &quot;WebMediaPlaybackTargetPickerProxy.h&quot;
+#include &lt;wtf/RetainPtr.h&gt;
+#include &lt;wtf/RunLoop.h&gt;
+
+OBJC_CLASS AVOutputDevicePickerMenuController;
+OBJC_CLASS WebAVOutputDevicePickerMenuControllerHelper;
+
+namespace WebKit {
+
+class WebMediaPlaybackTargetPickerProxyMac final : public WebMediaPlaybackTargetPickerProxy {
+    WTF_MAKE_NONCOPYABLE(WebMediaPlaybackTargetPickerProxyMac);
+public:
+    virtual ~WebMediaPlaybackTargetPickerProxyMac();
+
+    static std::unique_ptr&lt;WebMediaPlaybackTargetPickerProxyMac&gt; create(WebMediaPlaybackTargetPickerProxy::Client&amp;);
+
+    virtual void showPlaybackTargetPicker(const WebCore::FloatRect&amp;, bool) override;
+    virtual void startingMonitoringPlaybackTargets() override;
+    virtual void stopMonitoringPlaybackTargets() override;
+    
+    void availableDevicesDidChange();
+    void currentDeviceDidChange();
+
+private:
+    explicit WebMediaPlaybackTargetPickerProxyMac(WebMediaPlaybackTargetPickerProxy::Client&amp;);
+
+    AVOutputDevicePickerMenuController *devicePicker();
+    void outputeDeviceAvailabilityChangedTimerFired();
+
+    RetainPtr&lt;AVOutputDevicePickerMenuController&gt; m_devicePickerMenuController;
+    RetainPtr&lt;WebAVOutputDevicePickerMenuControllerHelper&gt; m_devicePickerMenuControllerDelegate;
+    RunLoop::Timer&lt;WebMediaPlaybackTargetPickerProxyMac&gt; m_deviceChangeTimer;
+};
+
+} // namespace WebKit
+
+#endif // ENABLE(WIRELESS_PLAYBACK_TARGET)
+
+#endif // WebContextMenuProxyMac_h
</ins></span></pre></div>
<a id="tagsSafari601122SourceWebKit2UIProcessmacWebMediaPlaybackTargetPickerProxyMacmmfromrev181442trunkSourceWebKit2UIProcessmacWebMediaPlaybackTargetPickerProxyMacmm"></a>
<div class="copfile"><h4>Copied: tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm (from rev 181442, trunk/Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm) (0 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm                                (rev 0)
+++ tags/Safari-601.1.22/Source/WebKit2/UIProcess/mac/WebMediaPlaybackTargetPickerProxyMac.mm        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -0,0 +1,188 @@
</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. AND ITS CONTRIBUTORS ``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 ITS 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;config.h&quot;
+#import &quot;WebMediaPlaybackTargetPickerProxyMac.h&quot;
+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+
+#import &lt;AVFoundation/AVOutputDevicePickerContext.h&gt;
+#import &lt;AVKit/AVOutputDevicePickerMenuController.h&gt;
+#import &lt;WebCore/FloatRect.h&gt;
+#import &lt;WebCore/MediaPlaybackTarget.h&gt;
+#import &lt;WebCore/SoftLinking.h&gt;
+#import &lt;objc/runtime.h&gt;
+#import &lt;wtf/MainThread.h&gt;
+
+typedef AVOutputDevicePickerContext AVOutputDevicePickerContextType;
+typedef AVOutputDevicePickerMenuController AVOutputDevicePickerMenuControllerType;
+
+SOFT_LINK_FRAMEWORK_OPTIONAL(AVFoundation)
+SOFT_LINK_FRAMEWORK_OPTIONAL(AVKit)
+
+SOFT_LINK_CLASS(AVFoundation, AVOutputDevicePickerContext)
+SOFT_LINK_CLASS(AVKit, AVOutputDevicePickerMenuController)
+SOFT_LINK_CLASS(AVKit, AVOutputDevicePickerDelegate)
+
+using namespace WebKit;
+
+static NSString *externalOutputDeviceAvailableKeyName = @&quot;externalOutputDeviceAvailable&quot;;
+static NSString *externalOutputDevicePickedKeyName = @&quot;externalOutputDevicePicked&quot;;
+
+@interface WebAVOutputDevicePickerMenuControllerHelper : NSObject {
+    WebMediaPlaybackTargetPickerProxyMac* m_callback;
+}
+
+- (instancetype)initWithCallback:(WebMediaPlaybackTargetPickerProxyMac*)callback;
+- (void)clearCallback;
+- (void)observeValueForKeyPath:(id)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context;
+@end
+
+namespace WebKit {
+
+std::unique_ptr&lt;WebMediaPlaybackTargetPickerProxyMac&gt; WebMediaPlaybackTargetPickerProxyMac::create(WebMediaPlaybackTargetPickerProxy::Client&amp; client)
+{
+    return std::unique_ptr&lt;WebMediaPlaybackTargetPickerProxyMac&gt;(new WebMediaPlaybackTargetPickerProxyMac(client));
+}
+
+WebMediaPlaybackTargetPickerProxyMac::WebMediaPlaybackTargetPickerProxyMac(WebMediaPlaybackTargetPickerProxy::Client&amp; client)
+    : WebMediaPlaybackTargetPickerProxy(client)
+    , m_devicePickerMenuControllerDelegate(adoptNS([[WebAVOutputDevicePickerMenuControllerHelper alloc] initWithCallback:this]))
+    , m_deviceChangeTimer(RunLoop::main(), this, &amp;WebMediaPlaybackTargetPickerProxyMac::outputeDeviceAvailabilityChangedTimerFired)
+{
+}
+
+WebMediaPlaybackTargetPickerProxyMac::~WebMediaPlaybackTargetPickerProxyMac()
+{
+    m_deviceChangeTimer.stop();
+    [m_devicePickerMenuControllerDelegate clearCallback];
+
+    if (m_devicePickerMenuController) {
+        [m_devicePickerMenuController.get() removeObserver:m_devicePickerMenuControllerDelegate.get() forKeyPath:externalOutputDeviceAvailableKeyName];
+        [m_devicePickerMenuController.get() removeObserver:m_devicePickerMenuControllerDelegate.get() forKeyPath:externalOutputDevicePickedKeyName];
+        m_devicePickerMenuController = nil;
+    }
+}
+
+void WebMediaPlaybackTargetPickerProxyMac::outputeDeviceAvailabilityChangedTimerFired()
+{
+    if (!m_devicePickerMenuController || !m_client)
+        return;
+
+    m_client-&gt;externalOutputDeviceAvailableDidChange(devicePicker().externalOutputDeviceAvailable);
+}
+
+void WebMediaPlaybackTargetPickerProxyMac::availableDevicesDidChange()
+{
+    if (!m_client)
+        return;
+
+    m_deviceChangeTimer.stop();
+    m_deviceChangeTimer.startOneShot(0);
+}
+
+AVOutputDevicePickerMenuControllerType *WebMediaPlaybackTargetPickerProxyMac::devicePicker()
+{
+    if (!m_devicePickerMenuController) {
+        RetainPtr&lt;AVOutputDevicePickerContextType&gt; context = adoptNS([[getAVOutputDevicePickerContextClass() alloc] init]);
+        m_devicePickerMenuController = adoptNS([[getAVOutputDevicePickerMenuControllerClass() alloc] initWithOutputDevicePickerContext:context.get()]);
+
+        [m_devicePickerMenuController.get() addObserver:m_devicePickerMenuControllerDelegate.get() forKeyPath:externalOutputDeviceAvailableKeyName options:NSKeyValueObservingOptionNew context:nullptr];
+        [m_devicePickerMenuController.get() addObserver:m_devicePickerMenuControllerDelegate.get() forKeyPath:externalOutputDevicePickedKeyName options:NSKeyValueObservingOptionNew context:nullptr];
+
+        if (devicePicker().externalOutputDeviceAvailable)
+            availableDevicesDidChange();
+    }
+
+    return m_devicePickerMenuController.get();
+}
+
+void WebMediaPlaybackTargetPickerProxyMac::showPlaybackTargetPicker(const WebCore::FloatRect&amp; location, bool)
+{
+    if (!m_client)
+        return;
+
+    [devicePicker() showMenuForRect:location appearanceName:NSAppearanceNameVibrantLight];
+}
+
+void WebMediaPlaybackTargetPickerProxyMac::currentDeviceDidChange()
+{
+    if (!m_client)
+        return;
+
+    m_client-&gt;didChoosePlaybackTarget(WebCore::MediaPlaybackTarget([devicePicker() outputDevicePickerContext]));
+}
+
+void WebMediaPlaybackTargetPickerProxyMac::startingMonitoringPlaybackTargets()
+{
+    devicePicker();
+}
+
+void WebMediaPlaybackTargetPickerProxyMac::stopMonitoringPlaybackTargets()
+{
+}
+
+} // namespace WebKit
+
+@implementation WebAVOutputDevicePickerMenuControllerHelper
+- (instancetype)initWithCallback:(WebMediaPlaybackTargetPickerProxyMac*)callback
+{
+    if (!(self = [super init]))
+        return nil;
+
+    m_callback = callback;
+
+    return self;
+}
+
+- (void)clearCallback
+{
+    m_callback = nil;
+}
+
+- (void)observeValueForKeyPath:(id)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void *)context
+{
+    if (!m_callback)
+        return;
+
+    if (![keyPath isEqualToString:externalOutputDeviceAvailableKeyName] &amp;&amp; ![keyPath isEqualToString:externalOutputDevicePickedKeyName])
+        return;
+
+    RetainPtr&lt;WebAVOutputDevicePickerMenuControllerHelper&gt; strongSelf = self;
+    RetainPtr&lt;NSString&gt; strongKeyPath = keyPath;
+    callOnMainThread([strongSelf, strongKeyPath] {
+        WebMediaPlaybackTargetPickerProxyMac* callback = strongSelf-&gt;m_callback;
+        if (!callback)
+            return;
+
+        if ([strongKeyPath isEqualToString:externalOutputDeviceAvailableKeyName])
+            callback-&gt;availableDevicesDidChange();
+        else if ([strongKeyPath isEqualToString:externalOutputDevicePickedKeyName])
+            callback-&gt;currentDeviceDidChange();
+    });
+}
+@end
+
+#endif // ENABLE(WIRELESS_PLAYBACK_TARGET)
</ins></span></pre></div>
<a id="tagsSafari601122SourceWebKit2WebKit2xcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/WebKit2.xcodeproj/project.pbxproj        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -76,6 +76,10 @@
</span><span class="cx">                 00B9661918E25AE100CE1F88 /* FindClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 00B9661718E25AE100CE1F88 /* FindClient.mm */; };
</span><span class="cx">                 00B9661A18E25AE100CE1F88 /* FindClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 00B9661818E25AE100CE1F88 /* FindClient.h */; };
</span><span class="cx">                 076E884E1A13CADF005E90FC /* APIContextMenuClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 076E884D1A13CADF005E90FC /* APIContextMenuClient.h */; };
</span><ins>+                0792164C1AA5501900A3C049 /* WebMediaPlaybackTargetPickerProxy.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 079216481AA54E9D00A3C049 /* WebMediaPlaybackTargetPickerProxy.cpp */; };
+                0792164D1AA5501F00A3C049 /* WebMediaPlaybackTargetPickerProxy.h in Headers */ = {isa = PBXBuildFile; fileRef = 079216491AA54E9D00A3C049 /* WebMediaPlaybackTargetPickerProxy.h */; };
+                079216501AA5528A00A3C049 /* WebMediaPlaybackTargetPickerProxyMac.h in Headers */ = {isa = PBXBuildFile; fileRef = 0792164E1AA5528A00A3C049 /* WebMediaPlaybackTargetPickerProxyMac.h */; };
+                079216511AA5528A00A3C049 /* WebMediaPlaybackTargetPickerProxyMac.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0792164F1AA5528A00A3C049 /* WebMediaPlaybackTargetPickerProxyMac.mm */; };
</ins><span class="cx">                 0F0C365818C051BA00F607D7 /* RemoteLayerTreeHostIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F0C365718C051BA00F607D7 /* RemoteLayerTreeHostIOS.mm */; };
</span><span class="cx">                 0F0C365A18C0555800F607D7 /* LayerRepresentation.h in Headers */ = {isa = PBXBuildFile; fileRef = 0F0C365918C0555800F607D7 /* LayerRepresentation.h */; };
</span><span class="cx">                 0F0C365C18C05CA100F607D7 /* RemoteScrollingCoordinatorProxyIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = 0F0C365B18C05CA100F607D7 /* RemoteScrollingCoordinatorProxyIOS.mm */; };
</span><span class="lines">@@ -2158,6 +2162,10 @@
</span><span class="cx">                 00B9661818E25AE100CE1F88 /* FindClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = FindClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 076E884D1A13CADF005E90FC /* APIContextMenuClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIContextMenuClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 076E884F1A13CBC6005E90FC /* APIInjectedBundlePageContextMenuClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = APIInjectedBundlePageContextMenuClient.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                079216481AA54E9D00A3C049 /* WebMediaPlaybackTargetPickerProxy.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = WebMediaPlaybackTargetPickerProxy.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                079216491AA54E9D00A3C049 /* WebMediaPlaybackTargetPickerProxy.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaPlaybackTargetPickerProxy.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0792164E1AA5528A00A3C049 /* WebMediaPlaybackTargetPickerProxyMac.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebMediaPlaybackTargetPickerProxyMac.h; sourceTree = &quot;&lt;group&gt;&quot;; };
+                0792164F1AA5528A00A3C049 /* WebMediaPlaybackTargetPickerProxyMac.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebMediaPlaybackTargetPickerProxyMac.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 0867D6A5FE840307C02AAC07 /* AppKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = AppKit.framework; path = /System/Library/Frameworks/AppKit.framework; sourceTree = &quot;&lt;absolute&gt;&quot;; };
</span><span class="cx">                 089C1667FE841158C02AAC07 /* English */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.strings; name = English; path = English.lproj/InfoPlist.strings; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 0F0C365718C051BA00F607D7 /* RemoteLayerTreeHostIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; name = RemoteLayerTreeHostIOS.mm; path = ios/RemoteLayerTreeHostIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -6145,6 +6153,8 @@
</span><span class="cx">                                 512E3520130B550100ABD19A /* WebApplicationCacheManagerProxy.cpp */,
</span><span class="cx">                                 512E3521130B550100ABD19A /* WebApplicationCacheManagerProxy.h */,
</span><span class="cx">                                 512E35F0130B638C00ABD19A /* WebApplicationCacheManagerProxy.messages.in */,
</span><ins>+                                079216481AA54E9D00A3C049 /* WebMediaPlaybackTargetPickerProxy.cpp */,
+                                079216491AA54E9D00A3C049 /* WebMediaPlaybackTargetPickerProxy.h */,
</ins><span class="cx">                                 BC72BA1B11E64907001EB4EA /* WebBackForwardList.cpp */,
</span><span class="cx">                                 BC72BA1C11E64907001EB4EA /* WebBackForwardList.h */,
</span><span class="cx">                                 F036978715F4BF0500C3A80E /* WebColorPicker.cpp */,
</span><span class="lines">@@ -7003,6 +7013,8 @@
</span><span class="cx">                                 2D125C5D1857EA05003BA3CB /* ViewGestureControllerMac.mm */,
</span><span class="cx">                                 2D6CD117189058A500E5A4A0 /* ViewSnapshotStore.h */,
</span><span class="cx">                                 2D6CD118189058A500E5A4A0 /* ViewSnapshotStore.mm */,
</span><ins>+                                0792164E1AA5528A00A3C049 /* WebMediaPlaybackTargetPickerProxyMac.h */,
+                                0792164F1AA5528A00A3C049 /* WebMediaPlaybackTargetPickerProxyMac.mm */,
</ins><span class="cx">                                 728E86EF1795188C0087879E /* WebColorPickerMac.h */,
</span><span class="cx">                                 728E86F01795188C0087879E /* WebColorPickerMac.mm */,
</span><span class="cx">                                 51ACBB9E127A8F2C00D203B9 /* WebContextMenuProxyMac.h */,
</span><span class="lines">@@ -8095,6 +8107,7 @@
</span><span class="cx">                                 7C361D79192803BD0036A59D /* WebUserContentControllerProxyMessages.h in Headers */,
</span><span class="cx">                                 3F889D15188778C900FEADAF /* WebVideoFullscreenManagerProxy.h in Headers */,
</span><span class="cx">                                 29CD55AA128E294F00133C85 /* WKAccessibilityWebPageObjectBase.h in Headers */,
</span><ins>+                                0792164D1AA5501F00A3C049 /* WebMediaPlaybackTargetPickerProxy.h in Headers */,
</ins><span class="cx">                                 29232DF418B29D6800D0596F /* WKAccessibilityWebPageObjectMac.h in Headers */,
</span><span class="cx">                                 2D0730A319F9C7DA00E9D9C4 /* WKActionMenuController.h in Headers */,
</span><span class="cx">                                 934B724419F5B9BE00AE96D6 /* WKActionMenuItemTypes.h in Headers */,
</span><span class="lines">@@ -8284,6 +8297,7 @@
</span><span class="cx">                                 1AB8A1F418400B8F00E9AE69 /* WKPageFindClient.h in Headers */,
</span><span class="cx">                                 1AB8A1F618400B9D00E9AE69 /* WKPageFindMatchesClient.h in Headers */,
</span><span class="cx">                                 1AB8A1F018400B0000E9AE69 /* WKPageFormClient.h in Headers */,
</span><ins>+                                079216501AA5528A00A3C049 /* WebMediaPlaybackTargetPickerProxyMac.h in Headers */,
</ins><span class="cx">                                 BC7B633712A45ABA00D174A4 /* WKPageGroup.h in Headers */,
</span><span class="cx">                                 1AB8A1EC1840080900E9AE69 /* WKPageLoaderClient.h in Headers */,
</span><span class="cx">                                 BC2D021912AC426C00E732A3 /* WKPageLoadTypes.h in Headers */,
</span><span class="lines">@@ -9549,6 +9563,7 @@
</span><span class="cx">                                 0FCB4E6318BBE3D9000FCFC9 /* PageClientImpl.mm in Sources */,
</span><span class="cx">                                 0FCB4E4718BBE044000FCFC9 /* PageClientImplIOS.mm in Sources */,
</span><span class="cx">                                 1AC7537B183A9FDB0072CB15 /* PageLoadState.cpp in Sources */,
</span><ins>+                                079216511AA5528A00A3C049 /* WebMediaPlaybackTargetPickerProxyMac.mm in Sources */,
</ins><span class="cx">                                 C574A58212E66681002DFE98 /* PasteboardTypes.mm in Sources */,
</span><span class="cx">                                 E19582D6153CC05400B60875 /* PDFKitImports.mm in Sources */,
</span><span class="cx">                                 2D870D1016234FFE000A3F20 /* PDFPlugin.mm in Sources */,
</span><span class="lines">@@ -9746,6 +9761,7 @@
</span><span class="cx">                                 BC111A5E112F4FBB00337BAB /* WebEditorClient.cpp in Sources */,
</span><span class="cx">                                 2D28F3E61885CCC1004B9EAE /* WebEditorClientIOS.mm in Sources */,
</span><span class="cx">                                 C5237F6012441CA300780472 /* WebEditorClientMac.mm in Sources */,
</span><ins>+                                0792164C1AA5501900A3C049 /* WebMediaPlaybackTargetPickerProxy.cpp in Sources */,
</ins><span class="cx">                                 BC111AE0112F5BC200337BAB /* WebErrorsMac.mm in Sources */,
</span><span class="cx">                                 C0337DAE127A24FE008FF4F4 /* WebEvent.cpp in Sources */,
</span><span class="cx">                                 BC032DBA10F4380F0058C15A /* WebEventConversion.cpp in Sources */,
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2WebProcessWebCoreSupportWebChromeClientcpp"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.cpp        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -1101,4 +1101,24 @@
</span><span class="cx">     return m_page-&gt;shouldDispatchFakeMouseMoveEvents();
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+void WebChromeClient::showPlaybackTargetPicker(const WebCore::IntPoint&amp; position, bool isVideo)
+{
+    FrameView* frameView = m_page-&gt;mainFrame()-&gt;view();
+    FloatRect rect(frameView-&gt;contentsToRootView(frameView-&gt;windowToContents(position)), FloatSize());
+    m_page-&gt;send(Messages::WebPageProxy::ShowPlaybackTargetPicker(rect, isVideo));
+}
+
+void WebChromeClient::startingMonitoringPlaybackTargets()
+{
+    m_page-&gt;send(Messages::WebPageProxy::StartingMonitoringPlaybackTargets());
+}
+
+void WebChromeClient::stopMonitoringPlaybackTargets()
+{
+    m_page-&gt;send(Messages::WebPageProxy::StopMonitoringPlaybackTargets());
+}
+#endif
+
+
</ins><span class="cx"> } // namespace WebKit
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2WebProcessWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebCoreSupport/WebChromeClient.h        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -310,6 +310,12 @@
</span><span class="cx"> 
</span><span class="cx">     virtual bool shouldDispatchFakeMouseMoveEvents() const override;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+    virtual void showPlaybackTargetPicker(const WebCore::IntPoint&amp;, bool) override;
+    virtual void startingMonitoringPlaybackTargets() override;
+    virtual void stopMonitoringPlaybackTargets() override;
+#endif
+
</ins><span class="cx">     String m_cachedToolTip;
</span><span class="cx">     mutable RefPtr&lt;WebFrame&gt; m_cachedFrameSetLargestFrame;
</span><span class="cx">     mutable bool m_cachedMainFrameHasHorizontalScrollbar;
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2WebProcessWebPageWebPageh"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/WebPage.h (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/WebPage.h        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -126,6 +126,7 @@
</span><span class="cx"> class HTMLPlugInImageElement;
</span><span class="cx"> class IntPoint;
</span><span class="cx"> class KeyboardEvent;
</span><ins>+class MediaPlaybackTarget;
</ins><span class="cx"> class Page;
</span><span class="cx"> class PrintContext;
</span><span class="cx"> class Range;
</span><span class="lines">@@ -142,7 +143,6 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><del>-
</del><span class="cx"> class DrawingArea;
</span><span class="cx"> class InjectedBundleBackForwardList;
</span><span class="cx"> class NotificationPermissionRequestManager;
</span><span class="lines">@@ -1093,6 +1093,11 @@
</span><span class="cx"> 
</span><span class="cx">     void setShouldDispatchFakeMouseMoveEvents(bool dispatch) { m_shouldDispatchFakeMouseMoveEvents = dispatch; }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+    void playbackTargetSelected(const WebCore::MediaPlaybackTarget&amp; outputDevice) const;
+    void playbackTargetAvailabilityDidChange(bool);
+#endif
+
</ins><span class="cx">     uint64_t m_pageID;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;WebCore::Page&gt; m_page;
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2WebProcessWebPageWebPagemessagesin"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/WebPage.messages.in        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -411,4 +411,10 @@
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     SetShouldDispatchFakeMouseMoveEvents(bool shouldDispatchFakeMouseMoveEvents)
</span><ins>+
+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+    PlaybackTargetSelected(WebCore::MediaPlaybackTarget target)
+    PlaybackTargetAvailabilityDidChange(bool available)
+#endif
+
</ins><span class="cx"> }
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -87,6 +87,10 @@
</span><span class="cx"> #import &lt;WebCore/htmlediting.h&gt;
</span><span class="cx"> #import &lt;WebKitSystemInterface.h&gt;
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET)
+#include &lt;WebCore/MediaPlaybackTarget.h&gt;
+#endif
+
</ins><span class="cx"> using namespace WebCore;
</span><span class="cx"> 
</span><span class="cx"> namespace WebKit {
</span><span class="lines">@@ -1187,6 +1191,20 @@
</span><span class="cx">     frame.editor().applyFontStyles(fontFamily, fontSize, fontTraits);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+#if ENABLE(WIRELESS_PLAYBACK_TARGET) &amp;&amp; !PLATFORM(IOS)
+void WebPage::playbackTargetSelected(const WebCore::MediaPlaybackTarget&amp; playbackTarget) const
+{
+    MediaPlaybackTarget nonConstTarget(playbackTarget.devicePickerContext());
+    m_page-&gt;didChoosePlaybackTarget(nonConstTarget);
+}
+
+void WebPage::playbackTargetAvailabilityDidChange(bool changed)
+{
+    m_page-&gt;playbackTargetAvailabilityDidChange(changed);
+}
+#endif
+
+
</ins><span class="cx"> } // namespace WebKit
</span><span class="cx"> 
</span><span class="cx"> #endif // PLATFORM(MAC)
</span></span></pre></div>
<a id="tagsSafari601122SourceWebKit2WebProcesscomappleWebProcesssbin"></a>
<div class="modfile"><h4>Modified: tags/Safari-601.1.22/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in (181443 => 181444)</h4>
<pre class="diff"><span>
<span class="info">--- tags/Safari-601.1.22/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in        2015-03-12 17:27:26 UTC (rev 181443)
+++ tags/Safari-601.1.22/Source/WebKit2/WebProcess/com.apple.WebProcess.sb.in        2015-03-12 17:41:25 UTC (rev 181444)
</span><span class="lines">@@ -297,3 +297,18 @@
</span><span class="cx">        (home-subpath &quot;/Library/Components&quot;)
</span><span class="cx">        (home-subpath &quot;/Library/Keyboard Layouts&quot;)
</span><span class="cx">        (home-subpath &quot;/Library/Input Methods&quot;))
</span><ins>+
+;; AirPlay
+;; FIXME: remove this as described in rdar://19869448
+(allow mach-lookup
+    (global-name &quot;com.apple.coremedia.endpoint.airplayuiagent&quot;)
+    (global-name &quot;com.apple.coremedia.endpointstream.airplayuiagent&quot;)
+    (global-name &quot;com.apple.coremedia.endpointplaybacksession.airplayuiagent&quot;)
+    (global-name &quot;com.apple.coremedia.endpointpicker&quot;))
+
+;; AirPlay
+(allow mach-lookup
+    (global-name &quot;com.apple.coremedia.endpoint.xpc&quot;)
+    (global-name &quot;com.apple.coremedia.endpointstream.xpc&quot;)
+    (global-name &quot;com.apple.coremedia.endpointplaybacksession.xpc&quot;)
+    (global-name &quot;com.apple.coremedia.endpointpicker.xpc&quot;))
</ins></span></pre>
</div>
</div>

</body>
</html>