<!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>[191181] trunk/Source/WebKit2</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/191181">191181</a></dd>
<dt>Author</dt> <dd>andersca@apple.com</dd>
<dt>Date</dt> <dd>2015-10-16 10:08:14 -0700 (Fri, 16 Oct 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Use the ShowContextMenu message for service menus as well
https://bugs.webkit.org/show_bug.cgi?id=150206

Reviewed by Tim Horton.

* Shared/ContextMenuContextData.cpp:
(WebKit::ContextMenuContextData::ContextMenuContextData):
(WebKit::ContextMenuContextData::encode):
(WebKit::ContextMenuContextData::decode):
* Shared/ContextMenuContextData.h:
(WebKit::ContextMenuContextData::type):
(WebKit::ContextMenuContextData::ContextMenuContextData):
(WebKit::ContextMenuContextData::isServicesMenu):
(WebKit::ContextMenuContextData::needsServicesMenu): Deleted.
* UIProcess/WebPageProxy.cpp:
(WebKit::WebPageProxy::showContextMenu):
(WebKit::WebPageProxy::internalShowContextMenu):
* UIProcess/WebPageProxy.h:
* UIProcess/WebPageProxy.messages.in:
* UIProcess/mac/WebContextMenuProxyMac.mm:
(WebKit::WebContextMenuProxyMac::populate):
(WebKit::WebContextMenuProxyMac::showContextMenu):
* UIProcess/mac/WebPageProxyMac.mm:
(WebKit::WebPageProxy::showSelectionServiceMenu): Deleted.
* WebProcess/WebPage/mac/WebPageMac.mm:
(WebKit::WebPage::handleSelectionServiceClick):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebKit2ChangeLog">trunk/Source/WebKit2/ChangeLog</a></li>
<li><a href="#trunkSourceWebKit2SharedContextMenuContextDatacpp">trunk/Source/WebKit2/Shared/ContextMenuContextData.cpp</a></li>
<li><a href="#trunkSourceWebKit2SharedContextMenuContextDatah">trunk/Source/WebKit2/Shared/ContextMenuContextData.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxycpp">trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxyh">trunk/Source/WebKit2/UIProcess/WebPageProxy.h</a></li>
<li><a href="#trunkSourceWebKit2UIProcessWebPageProxymessagesin">trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWebContextMenuProxyMacmm">trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm</a></li>
<li><a href="#trunkSourceWebKit2UIProcessmacWebPageProxyMacmm">trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm</a></li>
<li><a href="#trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm">trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/ChangeLog (191180 => 191181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/ChangeLog        2015-10-16 17:06:06 UTC (rev 191180)
+++ trunk/Source/WebKit2/ChangeLog        2015-10-16 17:08:14 UTC (rev 191181)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2015-10-15  Anders Carlsson  &lt;andersca@apple.com&gt;
+
+        Use the ShowContextMenu message for service menus as well
+        https://bugs.webkit.org/show_bug.cgi?id=150206
+
+        Reviewed by Tim Horton.
+
+        * Shared/ContextMenuContextData.cpp:
+        (WebKit::ContextMenuContextData::ContextMenuContextData):
+        (WebKit::ContextMenuContextData::encode):
+        (WebKit::ContextMenuContextData::decode):
+        * Shared/ContextMenuContextData.h:
+        (WebKit::ContextMenuContextData::type):
+        (WebKit::ContextMenuContextData::ContextMenuContextData):
+        (WebKit::ContextMenuContextData::isServicesMenu):
+        (WebKit::ContextMenuContextData::needsServicesMenu): Deleted.
+        * UIProcess/WebPageProxy.cpp:
+        (WebKit::WebPageProxy::showContextMenu):
+        (WebKit::WebPageProxy::internalShowContextMenu):
+        * UIProcess/WebPageProxy.h:
+        * UIProcess/WebPageProxy.messages.in:
+        * UIProcess/mac/WebContextMenuProxyMac.mm:
+        (WebKit::WebContextMenuProxyMac::populate):
+        (WebKit::WebContextMenuProxyMac::showContextMenu):
+        * UIProcess/mac/WebPageProxyMac.mm:
+        (WebKit::WebPageProxy::showSelectionServiceMenu): Deleted.
+        * WebProcess/WebPage/mac/WebPageMac.mm:
+        (WebKit::WebPage::handleSelectionServiceClick):
+
</ins><span class="cx"> 2015-10-16  Hunseop Jeong  &lt;hs85.jeong@samsung.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Try to fix the build after r191137
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedContextMenuContextDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/ContextMenuContextData.cpp (191180 => 191181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ContextMenuContextData.cpp        2015-10-16 17:06:06 UTC (rev 191180)
+++ trunk/Source/WebKit2/Shared/ContextMenuContextData.cpp        2015-10-16 17:08:14 UTC (rev 191181)
</span><span class="lines">@@ -38,14 +38,16 @@
</span><span class="cx"> namespace WebKit {
</span><span class="cx"> 
</span><span class="cx"> ContextMenuContextData::ContextMenuContextData()
</span><ins>+    : m_type(Type::ContextMenu)
</ins><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span><del>-    : m_selectionIsEditable(false)
</del><ins>+    , m_selectionIsEditable(false)
</ins><span class="cx"> #endif
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ContextMenuContextData::ContextMenuContextData(const WebCore::IntPoint&amp; menuLocation, const Vector&lt;WebKit::WebContextMenuItemData&gt;&amp; menuItems, const ContextMenuContext&amp; context)
</span><del>-    : m_menuLocation(menuLocation)
</del><ins>+    : m_type(Type::ContextMenu)
+    , m_menuLocation(menuLocation)
</ins><span class="cx">     , m_menuItems(menuItems)
</span><span class="cx">     , m_webHitTestResultData(context.hitTestResult(), true)
</span><span class="cx">     , m_selectedText(context.selectedText())
</span><span class="lines">@@ -66,6 +68,7 @@
</span><span class="cx"> 
</span><span class="cx"> void ContextMenuContextData::encode(IPC::ArgumentEncoder&amp; encoder) const
</span><span class="cx"> {
</span><ins>+    encoder.encodeEnum(m_type);
</ins><span class="cx">     encoder &lt;&lt; m_menuLocation;
</span><span class="cx">     encoder &lt;&lt; m_menuItems;
</span><span class="cx">     encoder &lt;&lt; m_webHitTestResultData;
</span><span class="lines">@@ -76,11 +79,17 @@
</span><span class="cx">     if (m_controlledImage)
</span><span class="cx">         m_controlledImage-&gt;createHandle(handle, SharedMemory::Protection::ReadOnly);
</span><span class="cx">     encoder &lt;&lt; handle;
</span><ins>+    encoder &lt;&lt; m_controlledSelectionData;
+    encoder &lt;&lt; m_selectedTelephoneNumbers;
+    encoder &lt;&lt; m_selectionIsEditable;
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool ContextMenuContextData::decode(IPC::ArgumentDecoder&amp; decoder, ContextMenuContextData&amp; result)
</span><span class="cx"> {
</span><ins>+    if (!decoder.decodeEnum(result.m_type))
+        return false;
+
</ins><span class="cx">     if (!decoder.decode(result.m_menuLocation))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="lines">@@ -100,6 +109,13 @@
</span><span class="cx"> 
</span><span class="cx">     if (!handle.isNull())
</span><span class="cx">         result.m_controlledImage = ShareableBitmap::create(handle, SharedMemory::Protection::ReadOnly);
</span><ins>+
+    if (!decoder.decode(result.m_controlledSelectionData))
+        return false;
+    if (!decoder.decode(result.m_selectedTelephoneNumbers))
+        return false;
+    if (!decoder.decode(result.m_selectionIsEditable))
+        return false;
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     return true;
</span></span></pre></div>
<a id="trunkSourceWebKit2SharedContextMenuContextDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/Shared/ContextMenuContextData.h (191180 => 191181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/Shared/ContextMenuContextData.h        2015-10-16 17:06:06 UTC (rev 191180)
+++ trunk/Source/WebKit2/Shared/ContextMenuContextData.h        2015-10-16 17:08:14 UTC (rev 191181)
</span><span class="lines">@@ -46,9 +46,15 @@
</span><span class="cx"> 
</span><span class="cx"> class ContextMenuContextData {
</span><span class="cx"> public:
</span><ins>+    enum class Type {
+        ContextMenu,
+        ServicesMenu,
+    };
+
</ins><span class="cx">     ContextMenuContextData();
</span><span class="cx">     ContextMenuContextData(const WebCore::IntPoint&amp; menuLocation, const Vector&lt;WebKit::WebContextMenuItemData&gt;&amp; menuItems, const WebCore::ContextMenuContext&amp;);
</span><span class="cx"> 
</span><ins>+    Type type() const { return m_type; }
</ins><span class="cx">     const WebCore::IntPoint&amp; menuLocation() const { return m_menuLocation; }
</span><span class="cx">     const Vector&lt;WebKit::WebContextMenuItemData&gt;&amp; menuItems() const { return m_menuItems; }
</span><span class="cx"> 
</span><span class="lines">@@ -56,9 +62,9 @@
</span><span class="cx">     const String&amp; selectedText() const { return m_selectedText; }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span><del>-    ContextMenuContextData(const WebCore::IntPoint&amp; menuLocation, const Vector&lt;WebKit::WebContextMenuItemData&gt;&amp; menuItems, const Vector&lt;uint8_t&gt;&amp; selectionData, const Vector&lt;String&gt;&amp; selectedTelephoneNumbers, bool isEditable)
-        : m_menuLocation(menuLocation)
-        , m_menuItems(menuItems)
</del><ins>+    ContextMenuContextData(const WebCore::IntPoint&amp; menuLocation, const Vector&lt;uint8_t&gt;&amp; selectionData, const Vector&lt;String&gt;&amp; selectedTelephoneNumbers, bool isEditable)
+        : m_type(Type::ServicesMenu)
+        , m_menuLocation(menuLocation)
</ins><span class="cx">         , m_controlledSelectionData(selectionData)
</span><span class="cx">         , m_selectedTelephoneNumbers(selectedTelephoneNumbers)
</span><span class="cx">         , m_selectionIsEditable(isEditable)
</span><span class="lines">@@ -69,14 +75,16 @@
</span><span class="cx">     const Vector&lt;uint8_t&gt;&amp; controlledSelectionData() const { return m_controlledSelectionData; }
</span><span class="cx">     const Vector&lt;String&gt;&amp; selectedTelephoneNumbers() const { return m_selectedTelephoneNumbers; }
</span><span class="cx"> 
</span><ins>+    bool isServicesMenu() const { return m_type == ContextMenuContextData::Type::ServicesMenu; }
</ins><span class="cx">     bool controlledDataIsEditable() const;
</span><del>-    bool needsServicesMenu() const { return m_controlledImage || !m_controlledSelectionData.isEmpty(); }
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     void encode(IPC::ArgumentEncoder&amp;) const;
</span><span class="cx">     static bool decode(IPC::ArgumentDecoder&amp;, ContextMenuContextData&amp;);
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    Type m_type;
+
</ins><span class="cx">     WebCore::IntPoint m_menuLocation;
</span><span class="cx">     Vector&lt;WebKit::WebContextMenuItemData&gt; m_menuItems;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxycpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp (191180 => 191181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-10-16 17:06:06 UTC (rev 191180)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.cpp        2015-10-16 17:08:14 UTC (rev 191181)
</span><span class="lines">@@ -4187,13 +4187,13 @@
</span><span class="cx">     // Showing a context menu runs a nested runloop, which can handle messages that cause |this| to get closed.
</span><span class="cx">     Ref&lt;WebPageProxy&gt; protect(*this);
</span><span class="cx"> 
</span><del>-    internalShowContextMenu(contextMenuContextData, ContextMenuClientEligibility::EligibleForClient, userData);
</del><ins>+    internalShowContextMenu(contextMenuContextData, userData);
</ins><span class="cx">     
</span><span class="cx">     // No matter the result of internalShowContextMenu, always notify the WebProcess that the menu is hidden so it starts handling mouse events again.
</span><span class="cx">     m_process-&gt;send(Messages::WebPage::ContextMenuHidden(), m_pageID);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void WebPageProxy::internalShowContextMenu(const ContextMenuContextData&amp; contextMenuContextData, ContextMenuClientEligibility clientEligibility, const UserData&amp; userData)
</del><ins>+void WebPageProxy::internalShowContextMenu(const ContextMenuContextData&amp; contextMenuContextData, const UserData&amp; userData)
</ins><span class="cx"> {
</span><span class="cx">     m_activeContextMenuContextData = contextMenuContextData;
</span><span class="cx"> 
</span><span class="lines">@@ -4210,9 +4210,9 @@
</span><span class="cx">     m_process-&gt;responsivenessTimer()-&gt;stop();
</span><span class="cx"> 
</span><span class="cx">     // Unless this is an image control, give the PageContextMenuClient one last swipe at changing the menu.
</span><del>-    bool askClientToChangeMenu = clientEligibility == ContextMenuClientEligibility::EligibleForClient;
</del><ins>+    bool askClientToChangeMenu = true;
</ins><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span><del>-    if (contextMenuContextData.controlledImage())
</del><ins>+    if (contextMenuContextData.isServicesMenu() || contextMenuContextData.controlledImage())
</ins><span class="cx">         askClientToChangeMenu = false;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxyh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.h (191180 => 191181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-10-16 17:06:06 UTC (rev 191180)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.h        2015-10-16 17:08:14 UTC (rev 191181)
</span><span class="lines">@@ -1262,12 +1262,8 @@
</span><span class="cx">     void hidePopupMenu();
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><del>-    enum class ContextMenuClientEligibility {
-        EligibleForClient,
-        NotEligibleForClient
-    };
</del><span class="cx">     void showContextMenu(const ContextMenuContextData&amp;, const UserData&amp;);
</span><del>-    void internalShowContextMenu(const ContextMenuContextData&amp;, ContextMenuClientEligibility, const UserData&amp;);
</del><ins>+    void internalShowContextMenu(const ContextMenuContextData&amp;, const UserData&amp;);
</ins><span class="cx">     WebCore::ContextMenuItem platformInitializeShareMenuItem(const ContextMenuContextData&amp;);
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -1277,10 +1273,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(SERVICE_CONTROLS)
-    void showSelectionServiceMenu(const IPC::DataReference&amp; selectionAsRTFD, const Vector&lt;String&gt;&amp; telephoneNumbers, bool isEditable, const WebCore::IntPoint&amp;);
-#endif
-
</del><span class="cx">     // Search popup results
</span><span class="cx">     void saveRecentSearches(const String&amp;, const Vector&lt;WebCore::RecentSearch&gt;&amp;);
</span><span class="cx">     void loadRecentSearches(const String&amp;, Vector&lt;WebCore::RecentSearch&gt;&amp;);
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessWebPageProxymessagesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in (191180 => 191181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-10-16 17:06:06 UTC (rev 191180)
+++ trunk/Source/WebKit2/UIProcess/WebPageProxy.messages.in        2015-10-16 17:08:14 UTC (rev 191181)
</span><span class="lines">@@ -247,7 +247,6 @@
</span><span class="cx">     HidePopupMenu()
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CONTEXT_MENUS)
</span><del>-    # ContextMenu messages
</del><span class="cx">     ShowContextMenu(WebKit::ContextMenuContextData contextMenuContextData, WebKit::UserData userData)
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="lines">@@ -408,10 +407,6 @@
</span><span class="cx"> #endif
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(SERVICE_CONTROLS)
-    ShowSelectionServiceMenu(IPC::DataReference selectionAsRTFD, Vector&lt;String&gt; telephoneNumbers, bool isEditable, WebCore::IntPoint point)
-#endif
-
</del><span class="cx"> #if USE(QUICK_LOOK)
</span><span class="cx">     DidStartLoadForQuickLookDocumentInMainFrame(String fileName, String uti)
</span><span class="cx">     DidFinishLoadForQuickLookDocumentInMainFrame(WebKit::QuickLookDocumentData data)
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWebContextMenuProxyMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm (191180 => 191181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm        2015-10-16 17:06:06 UTC (rev 191180)
+++ trunk/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm        2015-10-16 17:08:14 UTC (rev 191181)
</span><span class="lines">@@ -152,7 +152,6 @@
</span><span class="cx"> 
</span><span class="cx"> WebContextMenuProxyMac::WebContextMenuProxyMac(WKView* webView, WebPageProxy&amp; page, const ContextMenuContextData&amp; context, const UserData&amp; userData)
</span><span class="cx">     : WebContextMenuProxy(context, userData)
</span><del>-
</del><span class="cx">     , m_webView(webView)
</span><span class="cx">     , m_page(page)
</span><span class="cx"> {
</span><span class="lines">@@ -327,7 +326,7 @@
</span><span class="cx"> void WebContextMenuProxyMac::populate(const Vector&lt;RefPtr&lt;WebContextMenuItem&gt;&gt;&amp; items)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span><del>-    if (m_context.needsServicesMenu()) {
</del><ins>+    if (m_context.isServicesMenu()) {
</ins><span class="cx">         setupServicesMenu(m_context);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="lines">@@ -349,7 +348,7 @@
</span><span class="cx"> void WebContextMenuProxyMac::showContextMenu(const Vector&lt;RefPtr&lt;WebContextMenuItem&gt;&gt;&amp; items)
</span><span class="cx"> {
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span><del>-    if (items.isEmpty() &amp;&amp; !m_context.needsServicesMenu())
</del><ins>+    if (items.isEmpty() &amp;&amp; !m_context.isServicesMenu())
</ins><span class="cx">         return;
</span><span class="cx"> #else
</span><span class="cx">     if (items.isEmpty())
</span><span class="lines">@@ -364,7 +363,7 @@
</span><span class="cx">     NSRect menuRect = NSMakeRect(menuLocation.x, menuLocation.y, 0, 0);
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span><del>-    if (m_context.needsServicesMenu())
</del><ins>+    if (m_context.isServicesMenu())
</ins><span class="cx">         [[WKSharingServicePickerDelegate sharedSharingServicePickerDelegate] setMenuProxy:this];
</span><span class="cx"> 
</span><span class="cx">     if (!m_servicesMenu)
</span><span class="lines">@@ -376,7 +375,7 @@
</span><span class="cx">     // FIXME: That API is better than WKPopupContextMenu. In the future all menus should use either it
</span><span class="cx">     // or the [NSMenu popUpContextMenu:withEvent:forView:] API, depending on the menu type.
</span><span class="cx">     // Then we could get rid of NSPopUpButtonCell, custom metrics, and WKPopupContextMenu.
</span><del>-    if (m_context.needsServicesMenu()) {
</del><ins>+    if (m_context.isServicesMenu()) {
</ins><span class="cx">         [menu popUpMenuPositioningItem:nil atLocation:menuLocation inView:m_webView];
</span><span class="cx">         hideContextMenu();
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebKit2UIProcessmacWebPageProxyMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm (191180 => 191181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm        2015-10-16 17:06:06 UTC (rev 191180)
+++ trunk/Source/WebKit2/UIProcess/mac/WebPageProxyMac.mm        2015-10-16 17:08:14 UTC (rev 191181)
</span><span class="lines">@@ -684,16 +684,6 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-#if ENABLE(SERVICE_CONTROLS)
-void WebPageProxy::showSelectionServiceMenu(const IPC::DataReference&amp; selectionAsRTFD, const Vector&lt;String&gt;&amp; telephoneNumbers, bool isEditable, const IntPoint&amp; point)
-{
-    Vector&lt;WebContextMenuItemData&gt; items;
-    ContextMenuContextData contextData(point, items, selectionAsRTFD.vector(), telephoneNumbers, isEditable);
-
-    internalShowContextMenu(contextData, ContextMenuClientEligibility::NotEligibleForClient, UserData());
-}
-#endif
-
</del><span class="cx"> CGRect WebPageProxy::boundsOfLayerInLayerBackedWindowCoordinates(CALayer *layer) const
</span><span class="cx"> {
</span><span class="cx">     return m_pageClient.boundsOfLayerInLayerBackedWindowCoordinates(layer);
</span></span></pre></div>
<a id="trunkSourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (191180 => 191181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-10-16 17:06:06 UTC (rev 191180)
+++ trunk/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2015-10-16 17:08:14 UTC (rev 191181)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> 
</span><span class="cx"> #import &quot;AttributedString.h&quot;
</span><ins>+#import &quot;ContextMenuContextData.h&quot;
</ins><span class="cx"> #import &quot;DataReference.h&quot;
</span><span class="cx"> #import &quot;EditingRange.h&quot;
</span><span class="cx"> #import &quot;EditorState.h&quot;
</span><span class="lines">@@ -1056,11 +1057,12 @@
</span><span class="cx">     if (!attributedSelection)
</span><span class="cx">         return;
</span><span class="cx"> 
</span><del>-    NSData *selectionData = [attributedSelection RTFDFromRange:NSMakeRange(0, [attributedSelection length]) documentAttributes:@{ }];
-    IPC::DataReference data = IPC::DataReference(reinterpret_cast&lt;const uint8_t*&gt;([selectionData bytes]), [selectionData length]);
-    bool isEditable = selection.selection().isContentEditable();
</del><ins>+    NSData *selectionData = [attributedSelection RTFDFromRange:NSMakeRange(0, attributedSelection.length) documentAttributes:@{ }];
</ins><span class="cx"> 
</span><del>-    send(Messages::WebPageProxy::ShowSelectionServiceMenu(data, phoneNumbers, isEditable, point));
</del><ins>+    Vector&lt;uint8_t&gt; selectionDataVector;
+    selectionDataVector.append(reinterpret_cast&lt;const uint8_t*&gt;(selectionData.bytes), selectionData.length);
+
+    send(Messages::WebPageProxy::ShowContextMenu(ContextMenuContextData(point, selectionDataVector, phoneNumbers, selection.selection().isContentEditable()), UserData()));
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx"> 
</span></span></pre>
</div>
</div>

</body>
</html>