Provide UIImages for element actions
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 18:52:44 +0000 (18:52 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 3 May 2019 18:52:44 +0000 (18:52 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197539
<rdar://problem/50430363>

Reviewed by Wenson Hsieh.

Use an additions include to export a function that
relates a UIImage to a _WKElementAction.

* UIProcess/API/Cocoa/_WKElementAction.h:
* UIProcess/API/Cocoa/_WKElementAction.mm:
(_WKUIImageForElementActionType):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@244914 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebKit/ChangeLog
Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.h
Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm

index 31bd96c..e75a012 100644 (file)
@@ -1,3 +1,18 @@
+2019-05-02  Dean Jackson  <dino@apple.com>
+
+        Provide UIImages for element actions
+        https://bugs.webkit.org/show_bug.cgi?id=197539
+        <rdar://problem/50430363>
+
+        Reviewed by Wenson Hsieh.
+
+        Use an additions include to export a function that
+        relates a UIImage to a _WKElementAction.
+
+        * UIProcess/API/Cocoa/_WKElementAction.h:
+        * UIProcess/API/Cocoa/_WKElementAction.mm:
+        (_WKUIImageForElementActionType):
+
 2019-05-03  Jay Mulani  <jmulani@apple.com>
 
         Expose full screen controller SPI to check if full screen is open and close full screen
index 15885ea..958a63f 100644 (file)
 
 #if TARGET_OS_IPHONE
 
+#import <WebKit/WKBase.h>
 #import <WebKit/_WKActivatedElementInfo.h>
 
+@class UIImage;
+
 typedef void (^WKElementActionHandler)(_WKActivatedElementInfo *);
 typedef BOOL (^WKElementActionDismissalHandler)(void);
 
@@ -64,4 +67,14 @@ WK_CLASS_AVAILABLE(macos(10.10), ios(8.0))
 
 @end
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+WK_EXPORT UIImage *_WKUIImageForElementActionType(_WKElementActionType) WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+
+#ifdef __cplusplus
+}
+#endif
+
 #endif // TARGET_OS_IPHONE
index 8068ee5..512239a 100644 (file)
@@ -177,4 +177,13 @@ static void addToReadingList(NSURL *targetURL, NSString *title)
 
 @end
 
+#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKElementActionAdditions.m>)
+#include <WebKitAdditions/WKElementActionAdditions.m>
+#else
+UIImage *_WKUIImageForElementActionType(_WKElementActionType)
+{
+    return nil;
+}
+#endif
+
 #endif // PLATFORM(IOS_FAMILY)