Changeset 246867 in webkit
- Timestamp:
- Jun 26, 2019 6:28:57 PM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r246865 r246867 1 2019-06-26 Dean Jackson <dino@apple.com> 2 3 Add type to UIImage symbol mapping for _WKElementAction 4 https://bugs.webkit.org/show_bug.cgi?id=199255 5 6 Reviewed by Sam Weinig. 7 8 Moving some code in from WebKitAdditions now 9 that the API is public. 10 11 * UIProcess/API/Cocoa/_WKElementAction.mm: 12 (+[_WKElementAction imageForElementActionType:]): 13 (elementActionTypeToUIActionIdentifier): 14 (uiActionIdentifierToElementActionType): 15 1 16 2019-06-26 Dean Jackson <dino@apple.com> 2 17 -
trunk/Source/WebKit/UIProcess/API/Cocoa/_WKElementAction.mm
r246865 r246867 39 39 #import <wtf/text/WTFString.h> 40 40 41 #if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKElementActionAdditions.h>)42 #include <WebKitAdditions/WKElementActionAdditions.h>43 #endif44 45 41 #if HAVE(SAFARI_SERVICES_FRAMEWORK) 46 42 #import <SafariServices/SSReadingList.h> … … 194 190 } 195 191 196 #if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKElementActionAdditions.mm>) 197 #include <WebKitAdditions/WKElementActionAdditions.mm> 198 #else 192 #if USE(UICONTEXTMENU) 199 193 + (UIImage *)imageForElementActionType:(_WKElementActionType)actionType 200 194 { 201 return nil; 202 } 203 #endif 204 205 #if USE(UICONTEXTMENU) 195 switch (actionType) { 196 case _WKElementActionTypeCustom: 197 return nil; 198 case _WKElementActionTypeOpen: 199 return [UIImage systemImageNamed:@"safari"]; 200 case _WKElementActionTypeCopy: 201 return [UIImage systemImageNamed:@"doc.on.doc"]; 202 case _WKElementActionTypeSaveImage: 203 return [UIImage systemImageNamed:@"square.and.arrow.down"]; 204 case _WKElementActionTypeAddToReadingList: 205 return [UIImage systemImageNamed:@"eyeglasses"]; 206 case _WKElementActionTypeOpenInDefaultBrowser: 207 return [UIImage systemImageNamed:@"safari"]; 208 case _WKElementActionTypeOpenInExternalApplication: 209 return [UIImage systemImageNamed:@"arrow.up.right.square"]; 210 case _WKElementActionTypeShare: 211 return [UIImage systemImageNamed:@"square.and.arrow.up"]; 212 case _WKElementActionTypeOpenInNewTab: 213 return [UIImage systemImageNamed:@"plus.square.on.square"]; 214 case _WKElementActionTypeOpenInNewWindow: 215 return [UIImage systemImageNamed:@"square.grid.2x2"]; 216 case _WKElementActionTypeDownload: 217 return [UIImage systemImageNamed:@"arrow.down.circle"]; 218 } 219 } 220 206 221 static UIActionIdentifier elementActionTypeToUIActionIdentifier(_WKElementActionType actionType) 207 222 { … … 215 230 case _WKElementActionTypeSaveImage: 216 231 return WKElementActionTypeSaveImageIdentifier; 217 #if !defined(TARGET_OS_IOS) || TARGET_OS_IOS218 232 case _WKElementActionTypeAddToReadingList: 219 233 return WKElementActionTypeAddToReadingListIdentifier; … … 222 236 case _WKElementActionTypeOpenInExternalApplication: 223 237 return WKElementActionTypeOpenInExternalApplicationIdentifier; 224 #endif225 238 case _WKElementActionTypeShare: 226 239 return WKElementActionTypeShareIdentifier; … … 244 257 if ([identifier isEqualToString:WKElementActionTypeSaveImageIdentifier]) 245 258 return _WKElementActionTypeSaveImage; 246 #if !defined(TARGET_OS_IOS) || TARGET_OS_IOS247 259 if ([identifier isEqualToString:WKElementActionTypeAddToReadingListIdentifier]) 248 260 return _WKElementActionTypeAddToReadingList; … … 251 263 if ([identifier isEqualToString:WKElementActionTypeOpenInExternalApplicationIdentifier]) 252 264 return _WKElementActionTypeOpenInExternalApplication; 253 #endif254 265 if ([identifier isEqualToString:WKElementActionTypeShareIdentifier]) 255 266 return _WKElementActionTypeShare; … … 285 296 } 286 297 #else 298 + (UIImage *)imageForElementActionType:(_WKElementActionType)actionType 299 { 300 return nil; 301 } 302 287 303 + (_WKElementActionType)elementActionTypeForUIActionIdentifier:(UIActionIdentifier)identifier 288 304 { … … 294 310 return nil; 295 311 } 296 #endif 312 #endif // USE(UICONTEXTMENU) 297 313 298 314 @end
Note: See TracChangeset
for help on using the changeset viewer.