Add a share item to the link action menu
authortimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Mar 2015 18:39:13 +0000 (18:39 +0000)
committertimothy_horton@apple.com <timothy_horton@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 23 Mar 2015 18:39:13 +0000 (18:39 +0000)
commitde67764c9e8f83bb25900bb11f2fe26d601af148
tree6727025cf286c9834dc10bd249ee0137b7128936
parentd662f0fbd5f6d033e0c7d7117802136387230502
Add a share item to the link action menu
https://bugs.webkit.org/show_bug.cgi?id=142961
<rdar://problem/19198374>

Reviewed by Beth Dakin.

* UIProcess/mac/WKActionMenuController.mm:
(-[WKActionMenuController _hitLinkURL]):
Factor out _hitLinkURL from various places.

(-[WKActionMenuController _openURLFromActionMenu:]):
(-[WKActionMenuController _addToReadingListFromActionMenu:]):
(-[WKActionMenuController _defaultMenuItemsForVideo]):
(-[WKActionMenuController _defaultMenuItemsForImage]):
(-[WKActionMenuController _createActionMenuItemForTag:]):
(-[WKActionMenuController _createShareActionMenuItemForTag:withItems:]):
Adopt -[NSMenuItem standardShareMenuItemWithItems].
All of the null-checking is unnecessary as it's impossible to enter
these functions with a null image/etc.

(-[WKActionMenuController _defaultMenuItemsForLink]):
* Shared/API/c/WKActionMenuItemTypes.h:
Add a 'Share' item to the link menu.

* WebView/WebActionMenuController.mm:
(-[WebActionMenuController _defaultMenuItemsForImage]):
(-[WebActionMenuController _defaultMenuItemsForVideo]):
(-[WebActionMenuController _createActionMenuItemForTag:]):
(-[WebActionMenuController _createShareActionMenuItemForTag:withItems:]):
Adopt -[NSMenuItem standardShareMenuItemWithItems].
All of the null-checking is unnecessary as it's impossible to enter
these functions with a null image/etc.
Also, remove a duplicate isDownloadableMedia check for the 'save to downloads' item.

(-[WebActionMenuController _defaultMenuItemsForLink]):
* WebView/WebUIDelegatePrivate.h:
Add a 'Share' item to the link menu.

* English.lproj/Localizable.strings:
Remove some now-unused strings.

* platform/spi/mac/NSMenuSPI.h:
Add some SPI.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@181858 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Source/WebCore/ChangeLog
Source/WebCore/English.lproj/Localizable.strings
Source/WebCore/platform/spi/mac/NSMenuSPI.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebActionMenuController.mm
Source/WebKit/mac/WebView/WebUIDelegatePrivate.h
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/API/c/WKActionMenuItemTypes.h
Source/WebKit2/UIProcess/mac/WKActionMenuController.mm