<!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>[175302] branches/safari-600.3-branch/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/175302">175302</a></dd>
<dt>Author</dt> <dd>dburkart@apple.com</dd>
<dt>Date</dt> <dd>2014-10-28 21:24:27 -0700 (Tue, 28 Oct 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/174791">r174791</a>. <rdar://problem/18753175></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari6003branchSourceWebCoreChangeLog">branches/safari-600.3-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebCoreWebCoreexpin">branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in</a></li>
<li><a href="#branchessafari6003branchSourceWebCoreeditingEditorh">branches/safari-600.3-branch/Source/WebCore/editing/Editor.h</a></li>
<li><a href="#branchessafari6003branchSourceWebCoreeditingiosEditorIOSmm">branches/safari-600.3-branch/Source/WebCore/editing/ios/EditorIOS.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebCoreeditingmacEditorMacmm">branches/safari-600.3-branch/Source/WebCore/editing/mac/EditorMac.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKitChangeLog">branches/safari-600.3-branch/Source/WebKit/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebKitWebKitxcodeprojprojectpbxproj">branches/safari-600.3-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacChangeLog">branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacMiscWebSharingServicePickerControllerh">branches/safari-600.3-branch/Source/WebKit/mac/Misc/WebSharingServicePickerController.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacMiscWebSharingServicePickerControllermm">branches/safari-600.3-branch/Source/WebKit/mac/Misc/WebSharingServicePickerController.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebCoreSupportWebChromeClienth">branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebCoreSupportWebChromeClientmm">branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebCoreSupportWebContextMenuClienth">branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebCoreSupportWebContextMenuClientmm">branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewWebViewmm">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebView.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewWebViewDatah">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewWebViewDatamm">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewWebViewInternalh">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewInternal.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2ChangeLog">branches/safari-600.3-branch/Source/WebKit2/ChangeLog</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2UIProcessmacWebContextMenuProxyMacmm">branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm</a></li>
<li><a href="#branchessafari6003branchSourceWebKit2WebProcessWebPagemacWebPageMacmm">branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6003branchSourceWebKitmacWebCoreSupportWebSelectionServiceControllerh">branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebCoreSupportWebSelectionServiceControllermm">branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6003branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/ChangeLog (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/ChangeLog        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebCore/ChangeLog        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -1,5 +1,27 @@
</span><span class="cx"> 2014-10-28 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><ins>+ Merge r174791. <rdar://problem/18753175>
+
+ 2014-10-16 Tim Horton <timothy_horton@apple.com>
+
+ Implement selection services menu for Legacy WebKit
+ https://bugs.webkit.org/show_bug.cgi?id=137582
+ <rdar://problem/18604241>
+
+ Reviewed by Brady Eidson.
+
+ * WebCore.exp.in:
+ * editing/Editor.h:
+ * editing/ios/EditorIOS.mm:
+ (WebCore::Editor::replaceSelectionWithAttributedString):
+ * editing/mac/EditorMac.mm:
+ (WebCore::Editor::replaceSelectionWithAttributedString):
+ Add replaceSelectionWithAttributedString, which replaces the selection
+ with the given attributed string (converting to plain text if the destination
+ is not richly editable).
+
+2014-10-28 Dana Burkart <dburkart@apple.com>
+
</ins><span class="cx"> Merge r174524. <rdar://problem/18640868>
</span><span class="cx">
</span><span class="cx"> 2014-10-09 Tim Horton <timothy_horton@apple.com>
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebCoreWebCoreexpin"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebCore/WebCore.exp.in        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -1247,6 +1247,7 @@
</span><span class="cx"> __ZN7WebCore6Editor34setMarkedTextMatchesAreHighlightedEb
</span><span class="cx"> __ZN7WebCore6Editor35increaseSelectionListLevelUnorderedEv
</span><span class="cx"> __ZN7WebCore6Editor35setIgnoreCompositionSelectionChangeEb
</span><ins>+__ZN7WebCore6Editor36replaceSelectionWithAttributedStringEP18NSAttributedStringNS_22MailBlockquoteHandlingE
</ins><span class="cx"> __ZN7WebCore6Editor38commandIsSupportedFromMenuOrKeyBindingERKN3WTF6StringE
</span><span class="cx"> __ZN7WebCore6Editor39insertParagraphSeparatorInQuotedContentEv
</span><span class="cx"> __ZN7WebCore6Editor3cutEv
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebCoreeditingEditorh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/editing/Editor.h (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/editing/Editor.h        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebCore/editing/Editor.h        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -441,6 +441,7 @@
</span><span class="cx"> void replaceNodeFromPasteboard(Node*, const String& pasteboardName);
</span><span class="cx"> PassRefPtr<SharedBuffer> dataSelectionForPasteboard(const String& pasteboardName);
</span><span class="cx"> #endif // !PLATFORM(IOS)
</span><ins>+ void replaceSelectionWithAttributedString(NSAttributedString *, MailBlockquoteHandling = MailBlockquoteHandling::RespectBlockquote);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA) || PLATFORM(EFL)
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebCoreeditingiosEditorIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/editing/ios/EditorIOS.mm (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/editing/ios/EditorIOS.mm        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebCore/editing/ios/EditorIOS.mm        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -623,6 +623,22 @@
</span><span class="cx"> return fragment.release();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void Editor::replaceSelectionWithAttributedString(NSAttributedString *attributedString, MailBlockquoteHandling mailBlockquoteHandling)
+{
+ if (m_frame.selection().isNone())
+ return;
+
+ if (m_frame.selection().selection().isContentRichlyEditable()) {
+ RefPtr<DocumentFragment> fragment = createFragmentAndAddResources(attributedString);
+ if (fragment && shouldInsertFragment(fragment, selectedRange(), EditorInsertActionPasted))
+ pasteAsFragment(fragment, false, false, mailBlockquoteHandling);
+ } else {
+ String text = [attributedString string];
+ if (shouldInsertText(text, selectedRange().get(), EditorInsertActionPasted))
+ pasteAsPlainText(text, false);
+ }
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // PLATFORM(IOS)
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebCoreeditingmacEditorMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebCore/editing/mac/EditorMac.mm (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebCore/editing/mac/EditorMac.mm        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebCore/editing/mac/EditorMac.mm        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -668,4 +668,20 @@
</span><span class="cx"> return fragment.release();
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+void Editor::replaceSelectionWithAttributedString(NSAttributedString *attributedString, MailBlockquoteHandling mailBlockquoteHandling)
+{
+ if (m_frame.selection().isNone())
+ return;
+
+ if (m_frame.selection().selection().isContentRichlyEditable()) {
+ RefPtr<DocumentFragment> fragment = createFragmentAndAddResources(attributedString);
+ if (fragment && shouldInsertFragment(fragment, selectedRange(), EditorInsertActionPasted))
+ pasteAsFragment(fragment, false, false, mailBlockquoteHandling);
+ } else {
+ String text = [attributedString string];
+ if (shouldInsertText(text, selectedRange().get(), EditorInsertActionPasted))
+ pasteAsPlainText(text, false);
+ }
+}
+
</ins><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/ChangeLog (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/ChangeLog        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/ChangeLog        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -1,5 +1,19 @@
</span><span class="cx"> 2014-10-28 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><ins>+ Merge r174791. <rdar://problem/18753175>
+
+ 2014-10-16 Tim Horton <timothy_horton@apple.com>
+
+ Implement selection services menu for Legacy WebKit
+ https://bugs.webkit.org/show_bug.cgi?id=137582
+ <rdar://problem/18604241>
+
+ Reviewed by Brady Eidson.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
+2014-10-28 Dana Burkart <dburkart@apple.com>
+
</ins><span class="cx"> Merge r174368. <rdar://problem/18753175>
</span><span class="cx">
</span><span class="cx"> 2014-10-06 Brent Fulgham <bfulgham@apple.com>
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -83,6 +83,8 @@
</span><span class="cx">                 29AEF960134C76FB00FE5096 /* OutlookQuirksUserScript.js in Resources */ = {isa = PBXBuildFile; fileRef = 29AEF95D134C755400FE5096 /* OutlookQuirksUserScript.js */; };
</span><span class="cx">                 2D25396618CE85C200270222 /* WebSharingServicePickerController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2D25396418CE85C200270222 /* WebSharingServicePickerController.h */; };
</span><span class="cx">                 2D25396718CE85C200270222 /* WebSharingServicePickerController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2D25396518CE85C200270222 /* WebSharingServicePickerController.mm */; };
</span><ins>+                2DD632C219E5D1F0002E9C7B /* WebSelectionServiceController.h in Headers */ = {isa = PBXBuildFile; fileRef = 2DD632C019E5D1F0002E9C7B /* WebSelectionServiceController.h */; };
+                2DD632C319E5D1F0002E9C7B /* WebSelectionServiceController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 2DD632C119E5D1F0002E9C7B /* WebSelectionServiceController.mm */; };
</ins><span class="cx">                 312E2FE514E48182007CCA18 /* WebNotification.h in Headers */ = {isa = PBXBuildFile; fileRef = 312E2FE314E48182007CCA18 /* WebNotification.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 312E2FE614E48182007CCA18 /* WebNotification.mm in Sources */ = {isa = PBXBuildFile; fileRef = 312E2FE414E48182007CCA18 /* WebNotification.mm */; };
</span><span class="cx">                 312E2FE914E48215007CCA18 /* WebNotificationInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 312E2FE814E48215007CCA18 /* WebNotificationInternal.h */; };
</span><span class="lines">@@ -465,7 +467,7 @@
</span><span class="cx">                 0F30985D11ECFE4400F559DF /* WebRenderLayer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebRenderLayer.h; sourceTree = "<group>"; };
</span><span class="cx">                 0F30985E11ECFE4500F559DF /* WebRenderLayer.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebRenderLayer.mm; sourceTree = "<group>"; };
</span><span class="cx">                 14D8252D0AF955090004F057 /* WebChromeClient.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = WebChromeClient.h; sourceTree = "<group>"; };
</span><del>-                14D8252E0AF955090004F057 /* WebChromeClient.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = WebChromeClient.mm; sourceTree = "<group>"; };
</del><ins>+                14D8252E0AF955090004F057 /* WebChromeClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebChromeClient.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 1A2DBE9D0F251E3A0036F8A6 /* ProxyInstance.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ProxyInstance.h; sourceTree = "<group>"; };
</span><span class="cx">                 1A2DBE9E0F251E3A0036F8A6 /* ProxyInstance.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = ProxyInstance.mm; sourceTree = "<group>"; };
</span><span class="cx">                 1A4DF5200EC8C74D006BD4B4 /* WebNetscapePluginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNetscapePluginView.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -535,6 +537,8 @@
</span><span class="cx">                 2D36FD5E03F78F9E00A80166 /* WebFormDelegatePrivate.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFormDelegatePrivate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 2D81DAB203EB0B2D00A80166 /* WebFormDelegate.h */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebFormDelegate.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 2D81DAB303EB0B2D00A80166 /* WebFormDelegate.m */ = {isa = PBXFileReference; fileEncoding = 30; indentWidth = 4; lastKnownFileType = sourcecode.c.objc; path = WebFormDelegate.m; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
</span><ins>+                2DD632C019E5D1F0002E9C7B /* WebSelectionServiceController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSelectionServiceController.h; sourceTree = "<group>"; };
+                2DD632C119E5D1F0002E9C7B /* WebSelectionServiceController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebSelectionServiceController.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 312E2FE314E48182007CCA18 /* WebNotification.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotification.h; sourceTree = "<group>"; };
</span><span class="cx">                 312E2FE414E48182007CCA18 /* WebNotification.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebNotification.mm; sourceTree = "<group>"; };
</span><span class="cx">                 312E2FE814E48215007CCA18 /* WebNotificationInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebNotificationInternal.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -1572,6 +1576,8 @@
</span><span class="cx">                                 A5DEFC0711D5331C00885273 /* WebSecurityOrigin.mm */,
</span><span class="cx">                                 A5DEFC0811D5331C00885273 /* WebSecurityOriginInternal.h */,
</span><span class="cx">                                 A5DEFC0911D5331C00885273 /* WebSecurityOriginPrivate.h */,
</span><ins>+                                2DD632C019E5D1F0002E9C7B /* WebSelectionServiceController.h */,
+                                2DD632C119E5D1F0002E9C7B /* WebSelectionServiceController.mm */,
</ins><span class="cx">                                 93EB178E09F88D510091F8FF /* WebSystemInterface.h */,
</span><span class="cx">                                 93EB178C09F88D460091F8FF /* WebSystemInterface.mm */,
</span><span class="cx">                                 1AB1DAC018BC0232004B6A9F /* WebViewGroup.h */,
</span><span class="lines">@@ -1693,6 +1699,7 @@
</span><span class="cx">                                 7C01CB87173435C900C5D807 /* SearchPopupMenuMac.h in Headers */,
</span><span class="cx">                                 A10C1D6F1820300E0036883A /* WebGeolocationInternal.h in Headers */,
</span><span class="cx">                                 CEDA12DC152CBE6800D9E08D /* WebAlternativeTextClient.h in Headers */,
</span><ins>+                                2DD632C219E5D1F0002E9C7B /* WebSelectionServiceController.h in Headers */,
</ins><span class="cx">                                 B6CE5C25100BC5F500219936 /* WebApplicationCache.h in Headers */,
</span><span class="cx">                                 A10C1D721820300E0036883A /* WebMIMETypeRegistry.h in Headers */,
</span><span class="cx">                                 A5DEFC1311D5344B00885273 /* WebApplicationCacheQuotaManager.h in Headers */,
</span><span class="lines">@@ -2136,6 +2143,7 @@
</span><span class="cx">                                 1CCFFD130B1F81F2002EE926 /* OldWebAssertions.c in Sources */,
</span><span class="cx">                                 A10C1D8E1820305E0036883A /* WebPDFViewPlaceholder.mm in Sources */,
</span><span class="cx">                                 7C01CB86173435C900C5D807 /* PopupMenuMac.mm in Sources */,
</span><ins>+                                2DD632C319E5D1F0002E9C7B /* WebSelectionServiceController.mm in Sources */,
</ins><span class="cx">                                 A10C1D771820300E0036883A /* WebVisiblePosition.mm in Sources */,
</span><span class="cx">                                 1A2DBEA00F251E3A0036F8A6 /* ProxyInstance.mm in Sources */,
</span><span class="cx">                                 070F549C17F1E42B00169E04 /* WebUserMediaClient.mm in Sources */,
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -1,5 +1,91 @@
</span><span class="cx"> 2014-10-28 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><ins>+ Merge r174791. <rdar://problem/18753175>
+
+ 2014-10-16 Tim Horton <timothy_horton@apple.com>
+
+ Implement selection services menu for Legacy WebKit
+ https://bugs.webkit.org/show_bug.cgi?id=137582
+ <rdar://problem/18604241>
+
+ Reviewed by Brady Eidson.
+
+ * Misc/WebSharingServicePickerController.h:
+ Move SPI into the header (in the near future it will be moved to a modern-style SPI header).
+ Add WebSharingServicePickerClient, which other classes can implement
+ instead of tying WebSharingServicePickerController strongly to WebContextMenuClient.
+ Make initWithData:... -> initWithItems:... instead, taking an array of NSItemProviders.
+
+ * Misc/WebSharingServicePickerController.mm:
+ Pass in NSSharingServicePickerStyle, so that clients can specify the style.
+
+ (-[WebSharingServicePickerController clear]):
+ (-[WebSharingServicePickerController didShareImageData:confirmDataIsValidTIFFData:]):
+ (-[WebSharingServicePickerController sharingServicePicker:didChooseSharingService:]):
+ (-[WebSharingServicePickerController sharingService:sourceFrameOnScreenForShareItem:]):
+ (-[WebSharingServicePickerController sharingService:transitionImageForShareItem:contentRect:]):
+ (-[WebSharingServicePickerController sharingService:sourceWindowForShareItems:sharingContentScope:]):
+ Make use of WebSharingServicePickerClient.
+
+ (-[WebSharingServicePickerController sharingService:didShareItems:]):
+ If we're returned a NSAttributedString, paste it on top of the current selection,
+ similar to what the WebKit2 implementation currently does.
+
+ * WebCoreSupport/WebChromeClient.h:
+ * WebCoreSupport/WebChromeClient.mm:
+ (WebChromeClient::handleTelephoneNumberClick):
+ (WebChromeClient::handleSelectionServiceClick):
+ (WebChromeClient::hasRelevantSelectionServices):
+ Override the services-related ChromeClient functions, forward them to WebSelectionServiceController.
+
+ * WebCoreSupport/WebContextMenuClient.h:
+ * WebCoreSupport/WebContextMenuClient.mm:
+ (WebContextMenuClient::sharingServicePickerWillBeDestroyed):
+ (WebContextMenuClient::pageForSharingServicePicker):
+ (WebContextMenuClient::windowForSharingServicePicker):
+ (WebContextMenuClient::screenRectForCurrentSharingServicePickerItem):
+ (WebContextMenuClient::imageForCurrentSharingServicePickerItem):
+ (WebContextMenuClient::contextMenuForEvent):
+ (WebContextMenuClient::screenRectForHitTestNode): Deleted.
+ (WebContextMenuClient::renderedImageForControlledImage): Deleted.
+ (WebContextMenuClient::clearSharingServicePickerController): Deleted.
+ Have WebContextMenuClient implement WebSharingServicePickerClient to avoid
+ having WebSharingServicePickerController tightly bound to it.
+ Make an NSItemProvider array when instantiating WebSharingServicePickerController
+ instead of handing it data directly.
+
+ * WebCoreSupport/WebSelectionServiceController.h: Copied from Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.h.
+ * WebCoreSupport/WebSelectionServiceController.mm: Added.
+ (WebSelectionServiceController::WebSelectionServiceController):
+ Add WebSelectionServiceController, which will act as the WebSharingServicePickerClient
+ for selection services.
+
+ (WebSelectionServiceController::handleSelectionServiceClick):
+ Create a WebSharingSericePickerController with the selection's attributed string, and show its menu.
+
+ (hasCompatibleServicesForItems):
+ (WebSelectionServiceController::hasRelevantSelectionServices):
+ Determine whether or not services are available.
+
+ (WebSelectionServiceController::sharingServicePickerWillBeDestroyed):
+ (WebSelectionServiceController::pageForSharingServicePicker):
+ (WebSelectionServiceController::windowForSharingServicePicker):
+ Implement the rest of the WebSharingServicePickerClient overrides.
+
+ (WebSelectionServiceController::screenRectForCurrentSharingServicePickerItem):
+ (WebSelectionServiceController::imageForCurrentSharingServicePickerItem):
+ These are only useful for image sharing services, so we don't need to
+ implement them (WebContextMenuClient does, on the other hand).
+
+ * WebView/WebView.mm:
+ (-[WebView _selectionServiceController]):
+ * WebView/WebViewData.h:
+ * WebView/WebViewData.mm:
+ * WebView/WebViewInternal.h:
+ Keep a WebSelectionServiceController.
+
+2014-10-28 Dana Burkart <dburkart@apple.com>
+
</ins><span class="cx"> Merge r174525. <rdar://problem/18640876>
</span><span class="cx">
</span><span class="cx"> 2014-10-09 Tim Horton <timothy_horton@apple.com>
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacMiscWebSharingServicePickerControllerh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/Misc/WebSharingServicePickerController.h (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/Misc/WebSharingServicePickerController.h        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/mac/Misc/WebSharingServicePickerController.h        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -28,18 +28,55 @@
</span><span class="cx"> #import <wtf/RetainPtr.h>
</span><span class="cx">
</span><span class="cx"> @class NSSharingServicePicker;
</span><ins>+@class WebSharingServicePickerController;
</ins><span class="cx"> @protocol NSSharingServiceDelegate;
</span><span class="cx"> @protocol NSSharingServicePickerDelegate;
</span><span class="cx">
</span><ins>+#if __has_include(<AppKit/NSSharingService_Private.h>)
+#import <AppKit/NSSharingService_Private.h>
+#else
+typedef NS_ENUM(NSInteger, NSSharingServicePickerStyle) {
+ NSSharingServicePickerStyleMenu = 0,
+ NSSharingServicePickerStyleRollover = 1,
+ NSSharingServicePickerStyleTextSelection = 2,
+ NSSharingServicePickerStyleDataDetector = 3
+} NS_ENUM_AVAILABLE_MAC(10_10);
+
+typedef NS_ENUM(NSInteger, NSSharingServiceType) {
+ NSSharingServiceTypeShare = 0,
+ NSSharingServiceTypeViewer = 1,
+ NSSharingServiceTypeEditor = 2
+} NS_ENUM_AVAILABLE_MAC(10_10);
+
+typedef NSUInteger NSSharingServiceMask;
+#endif
+
+namespace WebCore {
+class FloatRect;
+class Page;
+}
+
</ins><span class="cx"> class WebContextMenuClient;
</span><span class="cx">
</span><ins>+class WebSharingServicePickerClient {
+public:
+ virtual ~WebSharingServicePickerClient() { }
+
+ virtual void sharingServicePickerWillBeDestroyed(WebSharingServicePickerController &) = 0;
+ virtual WebCore::Page* pageForSharingServicePicker(WebSharingServicePickerController &) = 0;
+ virtual RetainPtr<NSWindow> windowForSharingServicePicker(WebSharingServicePickerController &) = 0;
+
+ virtual WebCore::FloatRect screenRectForCurrentSharingServicePickerItem(WebSharingServicePickerController &) = 0;
+ virtual RetainPtr<NSImage> imageForCurrentSharingServicePickerItem(WebSharingServicePickerController &) = 0;
+};
+
</ins><span class="cx"> @interface WebSharingServicePickerController : NSObject <NSSharingServiceDelegate, NSSharingServicePickerDelegate> {
</span><del>- WebContextMenuClient* _menuClient;
</del><ins>+ WebSharingServicePickerClient* _pickerClient;
</ins><span class="cx"> RetainPtr<NSSharingServicePicker> _picker;
</span><span class="cx"> BOOL _includeEditorServices;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-- (instancetype)initWithData:(NSData *)data includeEditorServices:(BOOL)includeEditorServices menuClient:(WebContextMenuClient*)menuClient;
</del><ins>+- (instancetype)initWithItems:(NSArray *)items includeEditorServices:(BOOL)includeEditorServices client:(WebSharingServicePickerClient*)pickerClient style:(NSSharingServicePickerStyle)style;
</ins><span class="cx"> - (NSMenu *)menu;
</span><span class="cx"> - (void)didShareImageData:(NSData *)data confirmDataIsValidTIFFData:(BOOL)confirmData;
</span><span class="cx"> - (void)clear;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacMiscWebSharingServicePickerControllermm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/Misc/WebSharingServicePickerController.mm (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/Misc/WebSharingServicePickerController.mm        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/mac/Misc/WebSharingServicePickerController.mm        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -39,13 +39,6 @@
</span><span class="cx"> #import <WebCore/ContextMenuController.h>
</span><span class="cx"> #import <WebCore/Page.h>
</span><span class="cx">
</span><del>-#if __has_include(<AppKit/NSSharingService_Private.h>)
-#import <AppKit/NSSharingService_Private.h>
-#else
-typedef enum {
- NSSharingServicePickerStyleRollover = 1
-} NSSharingServicePickerStyle;
-
</del><span class="cx"> @interface NSSharingServicePicker (Private)
</span><span class="cx"> @property NSSharingServicePickerStyle style;
</span><span class="cx"> - (NSMenu *)menu;
</span><span class="lines">@@ -69,7 +62,7 @@
</span><span class="cx">
</span><span class="cx"> @implementation WebSharingServicePickerController
</span><span class="cx">
</span><del>-- (instancetype)initWithData:(NSData *)data includeEditorServices:(BOOL)includeEditorServices menuClient:(WebContextMenuClient*)menuClient
</del><ins>+- (instancetype)initWithItems:(NSArray *)items includeEditorServices:(BOOL)includeEditorServices client:(WebSharingServicePickerClient*)pickerClient style:(NSSharingServicePickerStyle)style
</ins><span class="cx"> {
</span><span class="cx"> #ifndef __LP64__
</span><span class="cx"> return nil;
</span><span class="lines">@@ -77,14 +70,12 @@
</span><span class="cx"> if (!(self = [super init]))
</span><span class="cx"> return nil;
</span><span class="cx">
</span><del>- RetainPtr<NSItemProvider> itemProvider = adoptNS([[NSItemProvider alloc] initWithItem:data typeIdentifier:@"public.data"]);
-
- _picker = adoptNS([[NSSharingServicePicker alloc] initWithItems:@[ itemProvider.get() ]]);
- [_picker setStyle:NSSharingServicePickerStyleRollover];
</del><ins>+ _picker = adoptNS([[NSSharingServicePicker alloc] initWithItems:items]);
+ [_picker setStyle:style];
</ins><span class="cx"> [_picker setDelegate:self];
</span><span class="cx">
</span><span class="cx"> _includeEditorServices = includeEditorServices;
</span><del>- _menuClient = menuClient;
</del><ins>+ _pickerClient = pickerClient;
</ins><span class="cx">
</span><span class="cx"> return self;
</span><span class="cx"> #endif
</span><span class="lines">@@ -95,11 +86,11 @@
</span><span class="cx"> // Protect self from being dealloc'ed partway through this method.
</span><span class="cx"> RetainPtr<WebSharingServicePickerController> protector(self);
</span><span class="cx">
</span><del>- if (_menuClient)
- _menuClient->clearSharingServicePickerController();
</del><ins>+ if (_pickerClient)
+ _pickerClient->sharingServicePickerWillBeDestroyed(*self);
</ins><span class="cx">
</span><span class="cx"> _picker = nullptr;
</span><del>- _menuClient = nullptr;
</del><ins>+ _pickerClient = nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSMenu *)menu
</span><span class="lines">@@ -109,7 +100,7 @@
</span><span class="cx">
</span><span class="cx"> - (void)didShareImageData:(NSData *)data confirmDataIsValidTIFFData:(BOOL)confirmData
</span><span class="cx"> {
</span><del>- Page* page = [_menuClient->webView() page];
</del><ins>+ Page* page = _pickerClient->pageForSharingServicePicker(*self);
</ins><span class="cx"> if (!page)
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -160,13 +151,18 @@
</span><span class="cx"> - (void)sharingServicePicker:(NSSharingServicePicker *)sharingServicePicker didChooseSharingService:(NSSharingService *)service
</span><span class="cx"> {
</span><span class="cx"> if (!service)
</span><del>- _menuClient->clearSharingServicePickerController();
</del><ins>+ _pickerClient->sharingServicePickerWillBeDestroyed(*self);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #pragma mark NSSharingServiceDelegate methods
</span><span class="cx">
</span><span class="cx"> - (void)sharingService:(NSSharingService *)sharingService didShareItems:(NSArray *)items
</span><span class="cx"> {
</span><ins>+ // We only care about what item was shared if we were interested in editor services
+ // (i.e., if we plan on replacing the selection with the returned item)
+ if (!_includeEditorServices)
+ return;
+
</ins><span class="cx"> // We only send one item, so we should only get one item back.
</span><span class="cx"> if ([items count] != 1)
</span><span class="cx"> return;
</span><span class="lines">@@ -198,8 +194,11 @@
</span><span class="cx"> }];
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><del>- else
- LOG_ERROR("sharingService:didShareItems: - Unknown item type returned");
</del><ins>+ else if ([item isKindOfClass:[NSAttributedString class]]) {
+ Frame& frame = _pickerClient->pageForSharingServicePicker(*self)->focusController().focusedOrMainFrame();
+ frame.editor().replaceSelectionWithAttributedString(item);
+ } else
+ LOG_ERROR("sharingService:didShareItems: - Unknown item type returned\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (void)sharingService:(NSSharingService *)sharingService didFailToShareItems:(NSArray *)items error:(NSError *)error
</span><span class="lines">@@ -209,25 +208,23 @@
</span><span class="cx">
</span><span class="cx"> - (NSRect)sharingService:(NSSharingService *)sharingService sourceFrameOnScreenForShareItem:(id <NSPasteboardWriting>)item
</span><span class="cx"> {
</span><del>- if (!_menuClient)
</del><ins>+ if (!_pickerClient)
</ins><span class="cx"> return NSZeroRect;
</span><span class="cx">
</span><del>- return _menuClient->screenRectForHitTestNode();
</del><ins>+ return _pickerClient->screenRectForCurrentSharingServicePickerItem(*self);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSImage *)sharingService:(NSSharingService *)sharingService transitionImageForShareItem:(id <NSPasteboardWriting>)item contentRect:(NSRect *)contentRect
</span><span class="cx"> {
</span><del>- if (!_menuClient)
</del><ins>+ if (!_pickerClient)
</ins><span class="cx"> return nil;
</span><span class="cx">
</span><del>- return _menuClient->renderedImageForControlledImage();
</del><ins>+ return _pickerClient->imageForCurrentSharingServicePickerItem(*self).get();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> - (NSWindow *)sharingService:(NSSharingService *)sharingService sourceWindowForShareItems:(NSArray *)items sharingContentScope:(NSSharingContentScope *)sharingContentScope
</span><span class="cx"> {
</span><del>- return [_menuClient->webView() window];
</del><ins>+ return _pickerClient->windowForSharingServicePicker(*self).get();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> @end
</span><del>-
-#endif
</del></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebCoreSupportWebChromeClienth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.h        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -205,6 +205,11 @@
</span><span class="cx"> virtual bool unwrapCryptoKey(const Vector<uint8_t>&, Vector<uint8_t>&) const override;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(SERVICE_CONTROLS)
+ virtual void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&) override;
+ virtual bool hasRelevantSelectionServices(bool isTextOnly) const override;
+#endif
+
</ins><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> WebView* webView() const { return m_webView; }
</span><span class="cx"> #else
</span><span class="lines">@@ -212,6 +217,5 @@
</span><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> private:
</span><del>-
</del><span class="cx"> WebView *m_webView;
</span><span class="cx"> };
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebCoreSupportWebChromeClientmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebChromeClient.mm        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -49,6 +49,7 @@
</span><span class="cx"> #import "WebPlugin.h"
</span><span class="cx"> #import "WebQuotaManager.h"
</span><span class="cx"> #import "WebSecurityOriginInternal.h"
</span><ins>+#import "WebSelectionServiceController.h"
</ins><span class="cx"> #import "WebUIDelegatePrivate.h"
</span><span class="cx"> #import "WebView.h"
</span><span class="cx"> #import "WebViewInternal.h"
</span><span class="lines">@@ -1041,3 +1042,16 @@
</span><span class="cx"> return unwrapSerializedCryptoKey(masterKey, wrappedKey, key);
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><ins>+
+#if ENABLE(SERVICE_CONTROLS)
+void WebChromeClient::handleSelectionServiceClick(WebCore::FrameSelection& selection, const Vector<String>& telephoneNumbers, const WebCore::IntPoint& point)
+{
+ [m_webView _selectionServiceController].handleSelectionServiceClick(selection, telephoneNumbers, point);
+}
+
+bool WebChromeClient::hasRelevantSelectionServices(bool isTextOnly) const
+{
+ return [m_webView _selectionServiceController].hasRelevantSelectionServices(isTextOnly);
+}
+
+#endif
</ins></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebCoreSupportWebContextMenuClienth"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.h (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.h        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.h        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
</span><span class="cx"> */
</span><span class="cx">
</span><ins>+#import "WebSharingServicePickerController.h"
</ins><span class="cx"> #import <WebCore/ContextMenuClient.h>
</span><span class="cx"> #import <WebCore/IntRect.h>
</span><span class="cx">
</span><span class="lines">@@ -36,10 +37,14 @@
</span><span class="cx"> class Node;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-class WebContextMenuClient : public WebCore::ContextMenuClient {
</del><ins>+class WebContextMenuClient : public WebCore::ContextMenuClient
+#if ENABLE(SERVICE_CONTROLS)
+, public WebSharingServicePickerClient
+#endif
+{
</ins><span class="cx"> public:
</span><span class="cx"> WebContextMenuClient(WebView *webView);
</span><del>- ~WebContextMenuClient();
</del><ins>+ virtual ~WebContextMenuClient();
</ins><span class="cx">
</span><span class="cx"> virtual void contextMenuDestroyed() override;
</span><span class="cx">
</span><span class="lines">@@ -55,11 +60,13 @@
</span><span class="cx"> virtual void searchWithSpotlight() override;
</span><span class="cx"> virtual void showContextMenu() override;
</span><span class="cx">
</span><del>- NSRect screenRectForHitTestNode() const;
-
</del><span class="cx"> #if ENABLE(SERVICE_CONTROLS)
</span><del>- void clearSharingServicePickerController();
- NSImage *renderedImageForControlledImage() const;
</del><ins>+ // WebSharingServicePickerClient
+ virtual void sharingServicePickerWillBeDestroyed(WebSharingServicePickerController &) override;
+ virtual WebCore::Page* pageForSharingServicePicker(WebSharingServicePickerController &) override;
+ virtual RetainPtr<NSWindow> windowForSharingServicePicker(WebSharingServicePickerController &) override;
+ virtual WebCore::FloatRect screenRectForCurrentSharingServicePickerItem(WebSharingServicePickerController &) override;
+ virtual RetainPtr<NSImage> imageForCurrentSharingServicePickerItem(WebSharingServicePickerController &) override;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> WebView *webView() { return m_webView; }
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebCoreSupportWebContextMenuClientmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebContextMenuClient.mm        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -387,8 +387,24 @@
</span><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-NSRect WebContextMenuClient::screenRectForHitTestNode() const
</del><ins>+#if ENABLE(SERVICE_CONTROLS)
+void WebContextMenuClient::sharingServicePickerWillBeDestroyed(WebSharingServicePickerController &)
</ins><span class="cx"> {
</span><ins>+ m_sharingServicePickerController = nil;
+}
+
+WebCore::Page* WebContextMenuClient::pageForSharingServicePicker(WebSharingServicePickerController &)
+{
+ return [m_webView page];
+}
+
+RetainPtr<NSWindow> WebContextMenuClient::windowForSharingServicePicker(WebSharingServicePickerController &)
+{
+ return [m_webView window];
+}
+
+WebCore::FloatRect WebContextMenuClient::screenRectForCurrentSharingServicePickerItem(WebSharingServicePickerController &)
+{
</ins><span class="cx"> Page* page = [m_webView page];
</span><span class="cx"> if (!page)
</span><span class="cx"> return NSZeroRect;
</span><span class="lines">@@ -415,8 +431,7 @@
</span><span class="cx"> return frameView->contentsToScreen(intRect);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if ENABLE(SERVICE_CONTROLS)
-NSImage *WebContextMenuClient::renderedImageForControlledImage() const
</del><ins>+RetainPtr<NSImage> WebContextMenuClient::imageForCurrentSharingServicePickerItem(WebSharingServicePickerController &)
</ins><span class="cx"> {
</span><span class="cx"> Page* page = [m_webView page];
</span><span class="cx"> if (!page)
</span><span class="lines">@@ -455,11 +470,10 @@
</span><span class="cx"> frameView->setPaintBehavior(oldPaintBehavior);
</span><span class="cx">
</span><span class="cx"> RefPtr<Image> image = buffer->copyImage(DontCopyBackingStore);
</span><del>- return [[image->getNSImage() retain] autorelease];
</del><ins>+ return image->getNSImage();
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-
</del><span class="cx"> NSMenu *WebContextMenuClient::contextMenuForEvent(NSEvent *event, NSView *view, bool& isServicesMenu)
</span><span class="cx"> {
</span><span class="cx"> isServicesMenu = false;
</span><span class="lines">@@ -472,12 +486,10 @@
</span><span class="cx"> if (Image* image = page->contextMenuController().context().controlledImage()) {
</span><span class="cx"> ASSERT(page->contextMenuController().context().hitTestResult().innerNode());
</span><span class="cx">
</span><del>- RefPtr<SharedBuffer> data = image->data();
- ASSERT(data);
- RetainPtr<CFDataRef> cfData = data->createCFData();
</del><ins>+ RetainPtr<NSItemProvider> itemProvider = adoptNS([[NSItemProvider alloc] initWithItem:image->getNSImage() typeIdentifier:@"public.image"]);
</ins><span class="cx">
</span><span class="cx"> bool isContentEditable = page->contextMenuController().context().hitTestResult().innerNode()->isContentEditable();
</span><del>- m_sharingServicePickerController = adoptNS([[WebSharingServicePickerController alloc] initWithData:(NSData *)cfData.get() includeEditorServices:isContentEditable menuClient:this]);
</del><ins>+ m_sharingServicePickerController = adoptNS([[WebSharingServicePickerController alloc] initWithItems:@[ itemProvider.get() ] includeEditorServices:isContentEditable client:this style:NSSharingServicePickerStyleRollover]);
</ins><span class="cx">
</span><span class="cx"> isServicesMenu = true;
</span><span class="cx"> return [m_sharingServicePickerController menu];
</span><span class="lines">@@ -513,11 +525,4 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><del>-#if ENABLE(SERVICE_CONTROLS)
-void WebContextMenuClient::clearSharingServicePickerController()
-{
- m_sharingServicePickerController = nil;
-}
-#endif
-
</del><span class="cx"> #endif // !PLATFORM(IOS)
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebCoreSupportWebSelectionServiceControllerhfromrev174791trunkSourceWebKitmacWebCoreSupportWebSelectionServiceControllerh"></a>
<div class="copfile"><h4>Copied: branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.h (from rev 174791, trunk/Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.h) (0 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.h         (rev 0)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.h        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -0,0 +1,67 @@
</span><ins>+/*
+ * Copyright (C) 2014 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 WebSelectionServiceController_h
+#define WebSelectionServiceController_h
+
+#if ENABLE(SERVICE_CONTROLS)
+
+#import "WebSharingServicePickerController.h"
+#import <wtf/RetainPtr.h>
+#import <wtf/Vector.h>
+#import <wtf/text/WTFString.h>
+
+OBJC_CLASS NSImage;
+OBJC_CLASS NSWindow;
+OBJC_CLASS WebView;
+
+namespace WebCore {
+class FrameSelection;
+class IntPoint;
+}
+
+class WebSelectionServiceController : public WebSharingServicePickerClient {
+public:
+ WebSelectionServiceController(WebView*);
+
+ void handleSelectionServiceClick(WebCore::FrameSelection&, const Vector<String>& telephoneNumbers, const WebCore::IntPoint&);
+ bool hasRelevantSelectionServices(bool isTextOnly) const;
+
+ // WebSharingServicePickerClient
+ virtual void sharingServicePickerWillBeDestroyed(WebSharingServicePickerController &) override;
+ virtual WebCore::Page* pageForSharingServicePicker(WebSharingServicePickerController &) override;
+ virtual RetainPtr<NSWindow> windowForSharingServicePicker(WebSharingServicePickerController &) override;
+ virtual WebCore::FloatRect screenRectForCurrentSharingServicePickerItem(WebSharingServicePickerController &) override;
+ virtual RetainPtr<NSImage> imageForCurrentSharingServicePickerItem(WebSharingServicePickerController &) override;
+
+private:
+ WebView *m_webView;
+
+ RetainPtr<WebSharingServicePickerController> m_sharingServicePickerController;
+};
+
+#endif // ENABLE(SERVICE_CONTROLS)
+
+#endif // WebSelectionServiceController_h
</ins></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebCoreSupportWebSelectionServiceControllermmfromrev174791trunkSourceWebKitmacWebCoreSupportWebSelectionServiceControllermm"></a>
<div class="copfile"><h4>Copied: branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm (from rev 174791, trunk/Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm) (0 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm         (rev 0)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebCoreSupport/WebSelectionServiceController.mm        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -0,0 +1,129 @@
</span><ins>+/*
+ * Copyright (C) 2014 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 "WebSelectionServiceController.h"
+
+#if ENABLE(SERVICE_CONTROLS)
+
+#import "WebViewInternal.h"
+#import <WebCore/FrameSelection.h>
+#import <WebCore/HTMLConverter.h>
+#import <WebCore/Range.h>
+#import <wtf/NeverDestroyed.h>
+
+using namespace WebCore;
+
+#if __has_include(<AppKit/NSSharingService_Private.h>)
+#import <AppKit/NSSharingService_Private.h>
+#else
+typedef NS_ENUM(NSInteger, NSSharingServicePickerStyle) {
+ NSSharingServicePickerStyleMenu = 0,
+ NSSharingServicePickerStyleRollover = 1,
+ NSSharingServicePickerStyleTextSelection = 2,
+ NSSharingServicePickerStyleDataDetector = 3
+} NS_ENUM_AVAILABLE_MAC(10_10);
+#endif
+
+WebSelectionServiceController::WebSelectionServiceController(WebView *webView)
+ : m_webView(webView)
+{
+}
+
+void WebSelectionServiceController::handleSelectionServiceClick(WebCore::FrameSelection& selection, const Vector<String>& telephoneNumbers, const WebCore::IntPoint& point)
+{
+ Page* page = [m_webView page];
+ if (!page)
+ return;
+
+ RefPtr<Range> range = selection.selection().firstRange();
+ if (!range)
+ return;
+
+ RetainPtr<NSAttributedString> attributedSelection = attributedStringFromRange(*range);
+ if (!attributedSelection)
+ return;
+
+ NSArray *items = @[ attributedSelection.get() ];
+
+ bool isEditable = selection.selection().isContentEditable();
+ m_sharingServicePickerController = adoptNS([[WebSharingServicePickerController alloc] initWithItems:items includeEditorServices:isEditable client:this style:NSSharingServicePickerStyleTextSelection]);
+
+ RetainPtr<NSMenu> menu = adoptNS([[m_sharingServicePickerController menu] copy]);
+
+ [menu setShowsStateColumn:YES];
+
+ [menu popUpMenuPositioningItem:nil atLocation:[m_webView convertPoint:point toView:nil] inView:m_webView];
+}
+
+static bool hasCompatibleServicesForItems(NSArray *items)
+{
+ return [NSSharingService sharingServicesForItems:items mask:NSSharingServiceMaskViewer | NSSharingServiceMaskEditor].count;
+}
+
+bool WebSelectionServiceController::hasRelevantSelectionServices(bool isTextOnly) const
+{
+ RetainPtr<NSAttributedString> attributedString = adoptNS([[NSAttributedString alloc] initWithString:@"a"]);
+
+ bool hasSelectionServices = hasCompatibleServicesForItems(@[ attributedString.get() ]);
+ if (isTextOnly && hasSelectionServices)
+ return true;
+
+ NSTextAttachment *attachment = [[NSTextAttachment alloc] init];
+ RetainPtr<NSImage> image = adoptNS([[NSImage alloc] init]);
+ NSTextAttachmentCell *cell = [[NSTextAttachmentCell alloc] initImageCell:image.get()];
+ [attachment setAttachmentCell:cell];
+ RetainPtr<NSMutableAttributedString> attributedStringWithRichContent = adoptNS((NSMutableAttributedString *)[NSMutableAttributedString attributedStringWithAttachment:attachment]);
+ [attributedStringWithRichContent appendAttributedString:attributedString.get()];
+
+ bool hasRichContentServices = hasCompatibleServicesForItems(@[ attributedStringWithRichContent.get() ]);
+ return hasRichContentServices;
+}
+
+void WebSelectionServiceController::sharingServicePickerWillBeDestroyed(WebSharingServicePickerController &)
+{
+ m_sharingServicePickerController = nil;
+}
+
+WebCore::Page* WebSelectionServiceController::pageForSharingServicePicker(WebSharingServicePickerController &)
+{
+ return [m_webView page];
+}
+
+RetainPtr<NSWindow> WebSelectionServiceController::windowForSharingServicePicker(WebSharingServicePickerController &)
+{
+ return [m_webView window];
+}
+
+FloatRect WebSelectionServiceController::screenRectForCurrentSharingServicePickerItem(WebSharingServicePickerController &)
+{
+ return FloatRect();
+}
+
+RetainPtr<NSImage> WebSelectionServiceController::imageForCurrentSharingServicePickerItem(WebSharingServicePickerController &)
+{
+ return nil;
+}
+
+#endif
</ins></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebView.mm (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebView.mm        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebView.mm        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -97,6 +97,7 @@
</span><span class="cx"> #import "WebProgressTrackerClient.h"
</span><span class="cx"> #import "WebScriptDebugDelegate.h"
</span><span class="cx"> #import "WebScriptWorldInternal.h"
</span><ins>+#import "WebSelectionServiceController.h"
</ins><span class="cx"> #import "WebStorageManagerInternal.h"
</span><span class="cx"> #import "WebSystemInterface.h"
</span><span class="cx"> #import "WebTextCompletionController.h"
</span><span class="lines">@@ -8518,6 +8519,15 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(SERVICE_CONTROLS)
+- (WebSelectionServiceController&)_selectionServiceController
+{
+ if (!_private->_selectionServiceController)
+ _private->_selectionServiceController = std::make_unique<WebSelectionServiceController>(self);
+ return *_private->_selectionServiceController;
+}
+#endif
+
</ins><span class="cx"> - (NSPoint)_convertPointFromRootView:(NSPoint)point
</span><span class="cx"> {
</span><span class="cx"> return NSMakePoint(point.x, [self bounds].size.height - point.y);
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebViewDatah"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.h (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.h        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.h        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -82,6 +82,7 @@
</span><span class="cx">
</span><span class="cx"> class LayerFlushController;
</span><span class="cx"> class WebViewGroup;
</span><ins>+class WebSelectionServiceController;
</ins><span class="cx">
</span><span class="cx"> class WebViewLayerFlushScheduler : public WebCore::LayerFlushScheduler {
</span><span class="cx"> public:
</span><span class="lines">@@ -270,6 +271,10 @@
</span><span class="cx"> id<WebUserMediaClient> m_userMediaClient;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(SERVICE_CONTROLS)
+ std::unique_ptr<WebSelectionServiceController> _selectionServiceController;
+#endif
+
</ins><span class="cx"> RefPtr<WebCore::HistoryItem> _globalHistoryItem;
</span><span class="cx">
</span><span class="cx"> BOOL interactiveFormValidationEnabled;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebViewDatamm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.mm (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.mm        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.mm        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx">
</span><span class="cx"> #import "WebKitLogging.h"
</span><span class="cx"> #import "WebPreferenceKeysPrivate.h"
</span><ins>+#import "WebSelectionServiceController.h"
</ins><span class="cx"> #import "WebViewGroup.h"
</span><span class="cx"> #import <WebCore/AlternativeTextUIController.h>
</span><span class="cx"> #import <WebCore/WebCoreObjCExtras.h>
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebViewInternalh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewInternal.h (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewInternal.h        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewInternal.h        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -56,6 +56,8 @@
</span><span class="cx"> class Node;
</span><span class="cx"> struct DictationAlternative;
</span><span class="cx"> }
</span><ins>+
+class WebSelectionServiceController;
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> @class WebBasePluginPackage;
</span><span class="lines">@@ -119,6 +121,10 @@
</span><span class="cx"> - (Vector<String>)_dictationAlternatives:(uint64_t)dictationContext;
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(SERVICE_CONTROLS)
+- (WebSelectionServiceController&)_selectionServiceController;
+#endif
+
</ins><span class="cx"> @end
</span><span class="cx">
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2ChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/ChangeLog (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/ChangeLog        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit2/ChangeLog        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -1,5 +1,25 @@
</span><span class="cx"> 2014-10-28 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><ins>+ Merge r174791. <rdar://problem/18753175>
+
+ 2014-10-16 Tim Horton <timothy_horton@apple.com>
+
+ Implement selection services menu for Legacy WebKit
+ https://bugs.webkit.org/show_bug.cgi?id=137582
+ <rdar://problem/18604241>
+
+ Reviewed by Brady Eidson.
+
+ * UIProcess/mac/WebContextMenuProxyMac.mm:
+ (-[WKSharingServicePickerDelegate sharingService:didShareItems:]):
+ Add a note that we should transition to using replaceSelectionWithAttributedString.
+
+ * WebProcess/WebPage/mac/WebPageMac.mm:
+ (WebKit::WebPage::handleSelectionServiceClick):
+ Allow editor services in editable-but-not-rich-text areas, just like in WebKit1.
+
+2014-10-28 Dana Burkart <dburkart@apple.com>
+
</ins><span class="cx"> Merge r174524. <rdar://problem/18640868>
</span><span class="cx">
</span><span class="cx"> 2014-10-09 Tim Horton <timothy_horton@apple.com>
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2UIProcessmacWebContextMenuProxyMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit2/UIProcess/mac/WebContextMenuProxyMac.mm        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -265,6 +265,7 @@
</span><span class="cx"> return;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ // FIXME: We should adopt replaceSelectionWithAttributedString instead of bouncing through the (fake) pasteboard.
</ins><span class="cx"> _menuProxy->page().replaceSelectionWithPasteboardData(types, dataReference);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKit2WebProcessWebPagemacWebPageMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm (175301 => 175302)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2014-10-29 04:21:21 UTC (rev 175301)
+++ branches/safari-600.3-branch/Source/WebKit2/WebProcess/WebPage/mac/WebPageMac.mm        2014-10-29 04:24:27 UTC (rev 175302)
</span><span class="lines">@@ -1034,7 +1034,7 @@
</span><span class="cx">
</span><span class="cx"> NSData *selectionData = [attributedSelection RTFDFromRange:NSMakeRange(0, [attributedSelection length]) documentAttributes:nil];
</span><span class="cx"> IPC::DataReference data = IPC::DataReference(reinterpret_cast<const uint8_t*>([selectionData bytes]), [selectionData length]);
</span><del>- bool isEditable = selection.selection().isContentRichlyEditable();
</del><ins>+ bool isEditable = selection.selection().isContentEditable();
</ins><span class="cx">
</span><span class="cx"> send(Messages::WebPageProxy::ShowSelectionServiceMenu(data, phoneNumbers, isEditable, point));
</span><span class="cx"> }
</span></span></pre>
</div>
</div>
</body>
</html>