WebKit1 should support action menus
authorbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Oct 2014 21:45:54 +0000 (21:45 +0000)
committerbdakin@apple.com <bdakin@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 24 Oct 2014 21:45:54 +0000 (21:45 +0000)
commitfc532a77b2a251e863b6c90a43da31fd97106cd3
tree4d26ed2ef016f32938b24259089956028b0f144d
parent29eb22951d3676393c37a05109cbf02e97846c4e
WebKit1 should support action menus
https://bugs.webkit.org/show_bug.cgi?id=138032

Reviewed by Tim Horton.

This patch adds basic support for action menus and adds actions for links.

Helper class takes care of all of the action menu work. WebView will forward the
prepareForMenu: message, and then the helper class takes it from there.
* WebView/WebActionMenuController.h: Added.
* WebView/WebActionMenuController.mm: Added.
(-[WebActionMenuController webViewClosed]):
(-[WebActionMenuController prepareForMenu:withEvent:]):

Selectors for link actions.
(-[WebActionMenuController _openURLFromActionMenu:]):
(-[WebActionMenuController _addToReadingListFromActionMenu:]):
(-[WebActionMenuController _elementBoundingBoxFromDOMElement:]):
(-[WebActionMenuController _quickLookURLFromActionMenu:]):
(-[WebActionMenuController _createActionMenuItemForTag:withHitTestResult:]):
(webKitBundleImageNamed):
(-[WebActionMenuController _defaultMenuItemsForLink:]):
(-[WebActionMenuController _defaultMenuItemsForHitTestResult:]):

Tags for the action menu items.
* WebView/WebUIDelegatePrivate.h:
* WebView/WebView.mm:

Set the action menu if possible and create the controller.
(-[WebView _initWithFrame:frameName:groupName:]):
(-[WebView _close]):
(-[WebView prepareForMenu:withEvent:]):

WebViewData stores the WebActionMenuHelper
* WebView/WebViewData.h:
* WebView/WebViewData.mm:
(-[WebViewPrivate dealloc]):

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