Make imageForElementActionType a class method on _WKElementAction
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 May 2019 01:01:49 +0000 (01:01 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 4 May 2019 01:01:49 +0000 (01:01 +0000)
https://bugs.webkit.org/show_bug.cgi?id=197588
<rdar://problem/50463157>

Reviewed by Wenson Hsieh.

Make this helper function a class method, so that it can
be more easily detected.

* UIProcess/API/Cocoa/_WKElementAction.h:
* UIProcess/API/Cocoa/_WKElementAction.mm:
(+[_WKElementAction imageForElementActionType:]):
(_WKUIImageForElementActionType): Deleted.

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

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

index dce1b4f..c08fcae 100644 (file)
@@ -1,3 +1,19 @@
+2019-05-03  Dean Jackson  <dino@apple.com>
+
+        Make imageForElementActionType a class method on _WKElementAction
+        https://bugs.webkit.org/show_bug.cgi?id=197588
+        <rdar://problem/50463157>
+
+        Reviewed by Wenson Hsieh.
+
+        Make this helper function a class method, so that it can
+        be more easily detected.
+
+        * UIProcess/API/Cocoa/_WKElementAction.h:
+        * UIProcess/API/Cocoa/_WKElementAction.mm:
+        (+[_WKElementAction imageForElementActionType:]):
+        (_WKUIImageForElementActionType): Deleted.
+
 2019-05-03  Chris Dumez  <cdumez@apple.com>
 
         Unresponsive Service Worker processes should get killed
index 958a63f..454dc6a 100644 (file)
@@ -59,6 +59,8 @@ WK_CLASS_AVAILABLE(macos(10.10), ios(8.0))
 + (instancetype)elementActionWithType:(_WKElementActionType)type customTitle:(NSString *)title;
 + (instancetype)elementActionWithTitle:(NSString *)title actionHandler:(WKElementActionHandler)handler;
 
++ (UIImage *)imageForElementActionType:(_WKElementActionType)actionType WK_API_AVAILABLE(macos(WK_MAC_TBA), ios(WK_IOS_TBA));
+
 - (void)runActionWithElementInfo:(_WKActivatedElementInfo *)info WK_API_AVAILABLE(ios(9_0));
 
 @property (nonatomic, readonly) _WKElementActionType type;
@@ -67,14 +69,4 @@ 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 512239a..c44493f 100644 (file)
 #import <wtf/WeakObjCPtr.h>
 #import <wtf/text/WTFString.h>
 
+#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKElementActionAdditions.h>)
+#include <WebKitAdditions/WKElementActionAdditions.h>
+#endif
+
 #if HAVE(SAFARI_SERVICES_FRAMEWORK)
 #import <SafariServices/SSReadingList.h>
 SOFT_LINK_FRAMEWORK(SafariServices);
@@ -175,15 +179,15 @@ static void addToReadingList(NSURL *targetURL, NSString *title)
     [self _runActionWithElementInfo:info forActionSheetAssistant:_defaultActionSheetAssistant.get().get()];
 }
 
-@end
-
-#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKElementActionAdditions.m>)
-#include <WebKitAdditions/WKElementActionAdditions.m>
+#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKElementActionAdditions.mm>)
+#include <WebKitAdditions/WKElementActionAdditions.mm>
 #else
-UIImage *_WKUIImageForElementActionType(_WKElementActionType)
++ (UIImage *)imageForElementActionType:(_WKElementActionType)actionType
 {
     return nil;
 }
 #endif
 
+@end
+
 #endif // PLATFORM(IOS_FAMILY)