Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Provide an action to save an image on a link sheet
https://bugs.webkit.org/show_bug.cgi?id=198464

Reviewed by Wenson Hsieh.

When providing the set of default actions for a link
sheet, if an URL to an image was provided then offer
the action to save that image to Photos.

* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant defaultActionsForLinkSheet:]):

Canonical link: https://commits.webkit.org/212489@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@246023 268f45cc-cd09-0410-ab3c-d52691b4dbfc
  • Loading branch information
grorg committed Jun 2, 2019
1 parent 3e933ca commit 70e3d70
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
14 changes: 14 additions & 0 deletions Source/WebKit/ChangeLog
@@ -1,3 +1,17 @@
2019-06-01 Dean Jackson <dino@apple.com>

Provide an action to save an image on a link sheet
https://bugs.webkit.org/show_bug.cgi?id=198464

Reviewed by Wenson Hsieh.

When providing the set of default actions for a link
sheet, if an URL to an image was provided then offer
the action to save that image to Photos.

* UIProcess/ios/WKActionSheetAssistant.mm:
(-[WKActionSheetAssistant defaultActionsForLinkSheet:]):

2019-06-01 Konstantin Tokarev <annulen@yandex.ru>

Remove include directives unused since r245186
Expand Down
6 changes: 6 additions & 0 deletions Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm
Expand Up @@ -542,6 +542,12 @@ - (void)_appendOpenActionsForURL:(NSURL *)url actions:(NSMutableArray *)defaultA
if ([getSSReadingListClass() supportsURL:targetURL])
[defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeAddToReadingList assistant:self]];
#endif

if ([elementInfo imageURL]) {
if (TCCAccessPreflight(getkTCCServicePhotos(), NULL) != kTCCAccessPreflightDenied)
[defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeSaveImage assistant:self]];
}

if (![[targetURL scheme] length] || [[targetURL scheme] caseInsensitiveCompare:@"javascript"] != NSOrderedSame) {
[defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeCopy assistant:self]];
[defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeShare assistant:self]];
Expand Down

0 comments on commit 70e3d70

Please sign in to comment.