<!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>[177338] branches/safari-600.3-branch/Source/WebKit</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/177338">177338</a></dd>
<dt>Author</dt> <dd>dburkart@apple.com</dd>
<dt>Date</dt> <dd>2014-12-16 00:08:44 -0800 (Tue, 16 Dec 2014)</dd>
</dl>
<h3>Log Message</h3>
<pre>Merged <a href="http://trac.webkit.org/projects/webkit/changeset/177131">r177131</a>. <rdar://problem/19198539></pre>
<h3>Modified Paths</h3>
<ul>
<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="#branchessafari6003branchSourceWebKitmacWebViewWebUIDelegatePrivateh">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebUIDelegatePrivate.h</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>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewWebImmediateActionControllerh">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebImmediateActionController.h</a></li>
<li><a href="#branchessafari6003branchSourceWebKitmacWebViewWebImmediateActionControllermm">branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebImmediateActionController.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari6003branchSourceWebKitChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/ChangeLog (177337 => 177338)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/ChangeLog        2014-12-16 08:03:47 UTC (rev 177337)
+++ branches/safari-600.3-branch/Source/WebKit/ChangeLog        2014-12-16 08:08:44 UTC (rev 177338)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2014-12-16 Dana Burkart <dburkart@apple.com>
+
+ Merged r177131. <rdar://problem/19198539>
+
+ 2014-12-10 Beth Dakin <bdakin@apple.com>
+
+ WK1: Add initial support for immediate actions
+ https://bugs.webkit.org/show_bug.cgi?id=139522
+
+ Reviewed by Dan Bernstein.
+
+ * WebKit.xcodeproj/project.pbxproj:
+
</ins><span class="cx"> 2014-12-04 Dana Burkart <dburkart@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r176766. <rdar://problem/19072083>
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitWebKitxcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj (177337 => 177338)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2014-12-16 08:03:47 UTC (rev 177337)
+++ branches/safari-600.3-branch/Source/WebKit/WebKit.xcodeproj/project.pbxproj        2014-12-16 08:08:44 UTC (rev 177338)
</span><span class="lines">@@ -159,6 +159,8 @@
</span><span class="cx">                 9304B3000B02341500F7850D /* WebIconDatabaseInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 9304B2FF0B02341500F7850D /* WebIconDatabaseInternal.h */; };
</span><span class="cx">                 931633EB0AEDFF930062B92D /* WebFrameLoaderClient.h in Headers */ = {isa = PBXBuildFile; fileRef = 931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */; };
</span><span class="cx">                 931633EF0AEDFFAE0062B92D /* WebFrameLoaderClient.mm in Sources */ = {isa = PBXBuildFile; fileRef = 931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */; };
</span><ins>+                9321D5921A391DC3008052BE /* WebImmediateActionController.h in Headers */ = {isa = PBXBuildFile; fileRef = 9321D5911A391DB8008052BE /* WebImmediateActionController.h */; };
+                9321D5941A391DF9008052BE /* WebImmediateActionController.mm in Sources */ = {isa = PBXBuildFile; fileRef = 9321D5931A391DF9008052BE /* WebImmediateActionController.mm */; };
</ins><span class="cx">                 934C11670D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 934C11660D8710BB00C32ABD /* WebDynamicScrollBarsViewInternal.h */; };
</span><span class="cx">                 934C4A910F01406C009372C0 /* WebNSObjectExtras.mm in Sources */ = {isa = PBXBuildFile; fileRef = 934C4A900F01406C009372C0 /* WebNSObjectExtras.mm */; };
</span><span class="cx">                 934C4AA00F0141F7009372C0 /* WebResourceInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 934C4A9F0F0141F7009372C0 /* WebResourceInternal.h */; };
</span><span class="lines">@@ -693,6 +695,8 @@
</span><span class="cx">                 931633EA0AEDFF930062B92D /* WebFrameLoaderClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebFrameLoaderClient.h; sourceTree = "<group>"; };
</span><span class="cx">                 931633EE0AEDFFAE0062B92D /* WebFrameLoaderClient.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebFrameLoaderClient.mm; sourceTree = "<group>"; };
</span><span class="cx">                 93185DB506679F42005D5E7E /* WebHTMLViewInternal.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebHTMLViewInternal.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
</span><ins>+                9321D5911A391DB8008052BE /* WebImmediateActionController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = WebImmediateActionController.h; sourceTree = "<group>"; };
+                9321D5931A391DF9008052BE /* WebImmediateActionController.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = WebImmediateActionController.mm; sourceTree = "<group>"; };
</ins><span class="cx">                 933D659903413FF2008635CE /* WebClipView.h */ = {isa = PBXFileReference; fileEncoding = 4; indentWidth = 4; lastKnownFileType = sourcecode.c.h; path = WebClipView.h; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 933D659A03413FF2008635CE /* WebClipView.mm */ = {isa = PBXFileReference; explicitFileType = sourcecode.cpp.objcpp; fileEncoding = 4; indentWidth = 4; path = WebClipView.mm; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
</span><span class="cx">                 9345D17C0365BF35008635CE /* English */ = {isa = PBXFileReference; indentWidth = 4; lastKnownFileType = wrapper.nib; name = English; path = Panels/English.lproj/WebAuthenticationPanel.nib; sourceTree = "<group>"; tabWidth = 8; usesTabs = 0; };
</span><span class="lines">@@ -1348,6 +1352,8 @@
</span><span class="cx">                                 BC7F889D10C9D30C00D6133D /* WebGeolocationPosition.mm */,
</span><span class="cx">                                 BC7F88A410C9D88B00D6133D /* WebGeolocationPositionInternal.h */,
</span><span class="cx">                                 5158F6EE106D862A00AF457C /* WebHistoryDelegate.h */,
</span><ins>+                                9321D5911A391DB8008052BE /* WebImmediateActionController.h */,
+                                9321D5931A391DF9008052BE /* WebImmediateActionController.mm */,
</ins><span class="cx">                                 A560946414D8AD2600799A8A /* WebIndicateLayer.h */,
</span><span class="cx">                                 A560946514D8AD2600799A8A /* WebIndicateLayer.mm */,
</span><span class="cx">                                 5185F62510712B80007AA393 /* WebNavigationData.h */,
</span><span class="lines">@@ -1912,6 +1918,7 @@
</span><span class="cx">                                 939810890824BF01008DF038 /* WebResourcePrivate.h in Headers */,
</span><span class="cx">                                 A10C1D3A18202FC50036883A /* WebNSStringExtrasIOS.h in Headers */,
</span><span class="cx">                                 7E6FEF0808985A7200C44C3F /* WebScriptDebugDelegate.h in Headers */,
</span><ins>+                                9321D5921A391DC3008052BE /* WebImmediateActionController.h in Headers */,
</ins><span class="cx">                                 C0167BF80D7F5DD00028696E /* WebScriptDebugger.h in Headers */,
</span><span class="cx">                                 C0B1F7E810AC8E3100C925D9 /* WebScriptWorld.h in Headers */,
</span><span class="cx">                                 C0B1F7EA10AC8E3100C925D9 /* WebScriptWorldInternal.h in Headers */,
</span><span class="lines">@@ -2177,6 +2184,7 @@
</span><span class="cx">                                 065AD5A40B0C32C7005A2B1D /* WebContextMenuClient.mm in Sources */,
</span><span class="cx">                                 939810BF0824BF01008DF038 /* WebCoreStatistics.mm in Sources */,
</span><span class="cx">                                 93E2A1A5123B0B3C009FE12A /* WebDashboardRegion.mm in Sources */,
</span><ins>+                                9321D5941A391DF9008052BE /* WebImmediateActionController.mm in Sources */,
</ins><span class="cx">                                 511F3FD50CECC88F00852565 /* WebDatabaseManager.mm in Sources */,
</span><span class="cx">                                 511F3FD80CECC88F00852565 /* WebDatabaseManagerClient.mm in Sources */,
</span><span class="cx">                                 A5DEFC1011D5343E00885273 /* WebDatabaseQuotaManager.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 (177337 => 177338)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog        2014-12-16 08:03:47 UTC (rev 177337)
+++ branches/safari-600.3-branch/Source/WebKit/mac/ChangeLog        2014-12-16 08:08:44 UTC (rev 177338)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2014-12-16 Dana Burkart <dburkart@apple.com>
+
+ Merged r177131. <rdar://problem/19198539>
+
+ 2014-12-10 Beth Dakin <bdakin@apple.com>
+
+ WK1: Add initial support for immediate actions
+ https://bugs.webkit.org/show_bug.cgi?id=139522
+
+ Reviewed by Dan Bernstein.
+
+ This basic implementation of the controller will use the delegate methods to
+ perform and cache a HitTest when relevant. Future patches will patch
+ _updateImmediateActionItem to use the HitTestResult to determine if there is any
+ immediate action that should be taken.
+ * WebView/WebImmediateActionController.h: Added.
+ * WebView/WebImmediateActionController.mm: Added.
+ (-[WebImmediateActionController webViewClosed]):
+ (-[WebImmediateActionController _clearImmediateActionState]):
+ (-[WebImmediateActionController performHitTestAtPoint:]):
+ (-[WebImmediateActionController immediateActionRecognizerWillPrepare:]):
+ (-[WebImmediateActionController immediateActionRecognizerWillBeginAnimation:]):
+ (-[WebImmediateActionController immediateActionRecognizerDidCancelAnimation:]):
+ (-[WebImmediateActionController immediateActionRecognizerDidCompleteAnimation:]):
+ (-[WebImmediateActionController _updateImmediateActionItem]):
+
+ New enum for immediate action types.
+ * WebView/WebUIDelegatePrivate.h:
+
+ Create an NSImmediateActionGestureRecognizer if possible and a controller.
+ * WebView/WebView.mm:
+ (-[WebView _commonInitializationWithFrameName:groupName:]):
+ (-[WebView _close]):
+ * WebView/WebViewData.h:
+ * WebView/WebViewData.mm:
+ (-[WebViewPrivate dealloc]):
+
</ins><span class="cx"> 2014-12-11 Matthew Hanson <matthew_hanson@apple.com>
</span><span class="cx">
</span><span class="cx"> Merge r177132. rdar://problem/19213620
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebImmediateActionControllerhfromrev177131trunkSourceWebKitmacWebViewWebImmediateActionControllerh"></a>
<div class="copfile"><h4>Copied: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebImmediateActionController.h (from rev 177131, trunk/Source/WebKit/mac/WebView/WebImmediateActionController.h) (0 => 177338)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebImmediateActionController.h         (rev 0)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebImmediateActionController.h        2014-12-16 08:08:44 UTC (rev 177338)
</span><span class="lines">@@ -0,0 +1,46 @@
</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.
+ */
+
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
+
+#import "WebUIDelegatePrivate.h"
+#import <WebCore/HitTestResult.h>
+#import <wtf/RetainPtr.h>
+
+@class WebView;
+
+@interface WebImmediateActionController : NSObject <NSGestureRecognizerDelegate> {
+@private
+ WebView *_webView;
+ WebImmediateActionType _type;
+ WebCore::HitTestResult _hitTestResult;
+}
+
+- (instancetype)initWithWebView:(WebView *)webView;
+- (void)webViewClosed;
+
+@end
+
+#endif // PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</ins></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebImmediateActionControllermmfromrev177131trunkSourceWebKitmacWebViewWebImmediateActionControllermm"></a>
<div class="copfile"><h4>Copied: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebImmediateActionController.mm (from rev 177131, trunk/Source/WebKit/mac/WebView/WebImmediateActionController.mm) (0 => 177338)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebImmediateActionController.mm         (rev 0)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebImmediateActionController.mm        2014-12-16 08:08:44 UTC (rev 177338)
</span><span class="lines">@@ -0,0 +1,122 @@
</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 "WebImmediateActionController.h"
+
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
+
+#import "WebFrameInternal.h"
+#import "WebHTMLView.h"
+#import "WebHTMLViewInternal.h"
+#import "WebUIDelegatePrivate.h"
+#import "WebViewInternal.h"
+#import <WebCore/EventHandler.h>
+#import <WebCore/Frame.h>
+#import <WebCore/NSImmediateActionGestureRecognizerSPI.h>
+#import <objc/objc-class.h>
+#import <objc/objc.h>
+
+using namespace WebCore;
+
+@implementation WebImmediateActionController
+
+- (instancetype)initWithWebView:(WebView *)webView
+{
+ if (!(self = [super init]))
+ return nil;
+
+ _webView = webView;
+ _type = WebImmediateActionNone;
+
+ return self;
+}
+
+- (void)webViewClosed
+{
+ _webView = nil;
+}
+
+- (void)_clearImmediateActionState
+{
+ _type = WebImmediateActionNone;
+}
+
+- (void)performHitTestAtPoint:(NSPoint)viewPoint
+{
+ Frame* coreFrame = core([[[[_webView _selectedOrMainFrame] frameView] documentView] _frame]);
+ if (!coreFrame)
+ return;
+ _hitTestResult = coreFrame->eventHandler().hitTestResultAtPoint(IntPoint(viewPoint));
+}
+
+#pragma mark NSGestureRecognizerDelegate
+
+- (void)immediateActionRecognizerWillPrepare:(NSImmediateActionGestureRecognizer *)immediateActionRecognizer
+{
+ if (!_webView)
+ return;
+
+ if (immediateActionRecognizer.view != _webView)
+ return;
+
+ WebHTMLView *documentView = [[[_webView _selectedOrMainFrame] frameView] documentView];
+ NSPoint locationInDocumentView = [immediateActionRecognizer locationInView:documentView];
+ [self performHitTestAtPoint:locationInDocumentView];
+}
+
+- (void)immediateActionRecognizerWillBeginAnimation:(NSImmediateActionGestureRecognizer *)immediateActionRecognizer
+{
+ if (immediateActionRecognizer.view != _webView)
+ return;
+
+ // FIXME: Add support for the types of functionality provided in Action menu's menuNeedsUpdate.
+}
+
+- (void)immediateActionRecognizerDidCancelAnimation:(NSImmediateActionGestureRecognizer *)immediateActionRecognizer
+{
+ if (immediateActionRecognizer.view != _webView)
+ return;
+
+ [self _clearImmediateActionState];
+}
+
+- (void)immediateActionRecognizerDidCompleteAnimation:(NSImmediateActionGestureRecognizer *)immediateActionRecognizer
+{
+ if (immediateActionRecognizer.view != _webView)
+ return;
+
+ // FIXME: Add support for the types of functionality provided in Action menu's willOpenMenu.
+}
+
+#pragma mark Immediate actions
+
+- (void)_updateImmediateActionItem
+{
+ // FIXME: Implement. Inspect _hitTestResult to determine if there is an immediate action to take.
+}
+
+@end
+
+#endif // PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</ins></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebUIDelegatePrivateh"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebUIDelegatePrivate.h (177337 => 177338)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebUIDelegatePrivate.h        2014-12-16 08:03:47 UTC (rev 177337)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebUIDelegatePrivate.h        2014-12-16 08:08:44 UTC (rev 177338)
</span><span class="lines">@@ -144,6 +144,10 @@
</span><span class="cx"> WebActionMenuTelLink
</span><span class="cx"> } WebActionMenuType;
</span><span class="cx">
</span><ins>+typedef enum {
+ WebImmediateActionNone = 0,
+} WebImmediateActionType;
+
</ins><span class="cx"> // Message Sources.
</span><span class="cx"> extern NSString *WebConsoleMessageXMLMessageSource;
</span><span class="cx"> extern NSString *WebConsoleMessageJSMessageSource;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebViewmm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebView.mm (177337 => 177338)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebView.mm        2014-12-16 08:03:47 UTC (rev 177337)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebView.mm        2014-12-16 08:08:44 UTC (rev 177338)
</span><span class="lines">@@ -204,12 +204,14 @@
</span><span class="cx"> #import "WebActionMenuController.h"
</span><span class="cx"> #import "WebContextMenuClient.h"
</span><span class="cx"> #import "WebFullScreenController.h"
</span><ins>+#import "WebImmediateActionController.h"
</ins><span class="cx"> #import "WebNSEventExtras.h"
</span><span class="cx"> #import "WebNSObjectExtras.h"
</span><span class="cx"> #import "WebNSPasteboardExtras.h"
</span><span class="cx"> #import "WebNSPrintOperationExtras.h"
</span><span class="cx"> #import "WebPDFView.h"
</span><span class="cx"> #import <WebCore/LookupSPI.h>
</span><ins>+#import <WebCore/NSImmediateActionGestureRecognizerSPI.h>
</ins><span class="cx"> #import <WebCore/NSViewSPI.h>
</span><span class="cx"> #import <WebCore/SoftLinking.h>
</span><span class="cx"> #import <WebCore/TextIndicator.h>
</span><span class="lines">@@ -895,6 +897,13 @@
</span><span class="cx"> _private->actionMenuController = [[WebActionMenuController alloc] initWithWebView:self];
</span><span class="cx"> self.actionMenu.autoenablesItems = NO;
</span><span class="cx"> }
</span><ins>+
+ if (Class gestureClass = NSClassFromString(@"NSImmediateActionGestureRecognizer")) {
+ RetainPtr<NSImmediateActionGestureRecognizer> recognizer = adoptNS([(NSImmediateActionGestureRecognizer *)[gestureClass alloc] initWithTarget:nil action:NULL]);
+ _private->immediateActionController = [[WebImmediateActionController alloc] initWithWebView:self];
+ [recognizer setDelegate:_private->immediateActionController];
+ [self addGestureRecognizer:recognizer.get()];
+ }
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(IOS)
</span><span class="lines">@@ -1745,6 +1754,7 @@
</span><span class="cx"> #endif
</span><span class="cx"> #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</span><span class="cx"> [_private->actionMenuController webViewClosed];
</span><ins>+ [_private->immediateActionController webViewClosed];
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(IOS)
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebViewDatah"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.h (177337 => 177338)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.h        2014-12-16 08:03:47 UTC (rev 177337)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.h        2014-12-16 08:08:44 UTC (rev 177338)
</span><span class="lines">@@ -51,6 +51,7 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> @class WebActionMenuController;
</span><ins>+@class WebImmediateActionController;
</ins><span class="cx"> @class WebInspector;
</span><span class="cx"> @class WebNodeHighlight;
</span><span class="cx"> @class WebPluginDatabase;
</span><span class="lines">@@ -150,6 +151,7 @@
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> #if __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</span><span class="cx"> WebActionMenuController *actionMenuController;
</span><ins>+ WebImmediateActionController *immediateActionController;
</ins><span class="cx"> #endif // __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</span><span class="cx"> std::unique_ptr<WebCore::TextIndicatorWindow> textIndicatorWindow;
</span><span class="cx"> BOOL hasInitializedLookupObserver;
</span></span></pre></div>
<a id="branchessafari6003branchSourceWebKitmacWebViewWebViewDatamm"></a>
<div class="modfile"><h4>Modified: branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.mm (177337 => 177338)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.mm        2014-12-16 08:03:47 UTC (rev 177337)
+++ branches/safari-600.3-branch/Source/WebKit/mac/WebView/WebViewData.mm        2014-12-16 08:08:44 UTC (rev 177338)
</span><span class="lines">@@ -147,6 +147,7 @@
</span><span class="cx"> [currentNodeHighlight release];
</span><span class="cx"> #if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101000
</span><span class="cx"> [actionMenuController release];
</span><ins>+ [immediateActionController release];
</ins><span class="cx"> #endif
</span><span class="cx"> [hostWindow release];
</span><span class="cx"> [policyDelegateForwarder release];
</span></span></pre>
</div>
</div>
</body>
</html>