⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 246023 in webkit


Ignore:
Timestamp:
Jun 2, 2019, 1:51:57 PM (7 years ago)
Author:
dino@apple.com
Message:

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:]):

Location:
trunk/Source/WebKit
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r246020 r246023  
     12019-06-01  Dean Jackson  <dino@apple.com>
     2
     3        Provide an action to save an image on a link sheet
     4        https://bugs.webkit.org/show_bug.cgi?id=198464
     5
     6        Reviewed by Wenson Hsieh.
     7
     8        When providing the set of default actions for a link
     9        sheet, if an URL to an image was provided then offer
     10        the action to save that image to Photos.
     11
     12        * UIProcess/ios/WKActionSheetAssistant.mm:
     13        (-[WKActionSheetAssistant defaultActionsForLinkSheet:]):
     14
    1152019-06-01  Konstantin Tokarev  <annulen@yandex.ru>
    216
  • trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm

    r244955 r246023  
    543543        [defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeAddToReadingList assistant:self]];
    544544#endif
     545
     546    if ([elementInfo imageURL]) {
     547        if (TCCAccessPreflight(getkTCCServicePhotos(), NULL) != kTCCAccessPreflightDenied)
     548            [defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeSaveImage assistant:self]];
     549    }
     550
    545551    if (![[targetURL scheme] length] || [[targetURL scheme] caseInsensitiveCompare:@"javascript"] != NSOrderedSame) {
    546552        [defaultActions addObject:[_WKElementAction _elementActionWithType:_WKElementActionTypeCopy assistant:self]];
Note: See TracChangeset for help on using the changeset viewer.