Implement Lookup transition from selection for Legacy WebKit
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Dec 2014 19:38:05 +0000 (19:38 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 2 Dec 2014 19:38:05 +0000 (19:38 +0000)
commit672af8c68d7d75f6b23457bf504e6ae57b964a39
tree891417494279c0af8bc4de6ae5c522a4d34cc933
parent52de40c9db59dc5a0c3fd54489524beefc9389a7
Implement Lookup transition from selection for Legacy WebKit
https://bugs.webkit.org/show_bug.cgi?id=139180
<rdar://problem/19067172>

Reviewed by Beth Dakin.

* WebView/DictionaryPopupInfo.h: Added.
Split DictionaryPopupInfo out into its own file.

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _lookupText:]):
Hand the DictionaryPopupInfo to WebView, which will show the TextIndicator and invoke Lookup.

(performDictionaryLookupForSelection):
(performDictionaryLookupForRange):
Plumb the transition style through these helpers.
Create a TextIndicator from the selection range.

* WebView/WebHTMLView.mm:
(-[WebHTMLView _lookUpInDictionaryFromMenu:]):
Make use of TextIndicator (and DictionaryPopupInfo, and the new
_showDictionaryLookupPopup on WebView) to add a transition from blue
when performing Lookup from the context menu.

(-[WebHTMLView quickLookWithEvent:]):
Remove our TextIndicator whenever a normal three-finger-tap event
comes through, as it will have its own indication.

* WebView/WebView.mm:
(-[WebView _commonInitializationWithFrameName:groupName:]):
(-[WebView _dictionaryLookupPopoverWillClose:]):
Register for the LUNotificationPopoverWillClose notification and remove
our TextIndicator when it is called, just like in WebKit2.
Deregistration is already handled in _close.

(-[WebView _showDictionaryLookupPopup:]):
Just like WebKit2, show our TextIndicator and tell Lookup not to show its own,
if the relevant API is available.

* WebView/WebViewInternal.h:

* WebKit.xcodeproj/project.pbxproj:
Add mac/WebView/DictionaryPopupInfo.h.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@176680 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebKit/ChangeLog
Source/WebKit/WebKit.xcodeproj/project.pbxproj
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/DictionaryPopupInfo.h [new file with mode: 0644]
Source/WebKit/mac/WebView/WebActionMenuController.mm
Source/WebKit/mac/WebView/WebHTMLView.mm
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit/mac/WebView/WebViewInternal.h