Title: [246023] trunk/Source/WebKit
Revision
246023
Author
[email protected]
Date
2019-06-02 13:51:57 -0700 (Sun, 02 Jun 2019)

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

Modified Paths

Diff

Modified: trunk/Source/WebKit/ChangeLog (246022 => 246023)


--- trunk/Source/WebKit/ChangeLog	2019-06-02 20:02:00 UTC (rev 246022)
+++ trunk/Source/WebKit/ChangeLog	2019-06-02 20:51:57 UTC (rev 246023)
@@ -1,3 +1,17 @@
+2019-06-01  Dean Jackson  <[email protected]>
+
+        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  <[email protected]>
 
         Remove include directives unused since r245186

Modified: trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm (246022 => 246023)


--- trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm	2019-06-02 20:02:00 UTC (rev 246022)
+++ trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm	2019-06-02 20:51:57 UTC (rev 246023)
@@ -542,6 +542,12 @@
     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]];
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to