Changeset 261478 in webkit
- Timestamp:
- May 11, 2020, 7:59:28 AM (5 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r261473 r261478 1 2020-05-11 Wenson Hsieh <wenson_hsieh@apple.com> 2 3 Unreviewed, fix the watchOS build after r261457 4 5 Put -[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:] behind a USE(UICONTEXTMENU) 6 compiler guard; currently, it is declared everywhere, but only implemented if ENABLE(DATA_DETECTION) && 7 USE(UICONTEXTMENU). However, WKContentView only invokes it behind code that is guarded by USE(UICONTEXTMENU). 8 9 * UIProcess/ios/WKActionSheetAssistant.h: 10 * UIProcess/ios/WKActionSheetAssistant.mm: 11 (-[WKActionSheetAssistant suggestedActionsForContextMenuWithPositionInformation:]): 12 1 13 2020-05-11 Philippe Normand <pnormand@igalia.com> 2 14 -
trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.h
r261457 r261478 91 91 - (void)interactionDidStartWithPositionInformation:(const WebKit::InteractionInformationAtPosition&)information; 92 92 - (NSArray *)currentAvailableActionTitles; 93 #if USE(UICONTEXTMENU) 93 94 - (NSArray<UIMenuElement *> *)suggestedActionsForContextMenuWithPositionInformation:(const WebKit::InteractionInformationAtPosition&)positionInformation; 95 #endif 94 96 @end 95 97 -
trunk/Source/WebKit/UIProcess/ios/WKActionSheetAssistant.mm
r261457 r261478 721 721 } 722 722 723 #if USE(UICONTEXTMENU) && ENABLE(DATA_DETECTION) 723 #if USE(UICONTEXTMENU) 724 725 static NSArray<UIMenuElement *> *menuElementsFromDefaultActions(RetainPtr<NSArray> defaultElementActions, RetainPtr<_WKActivatedElementInfo> elementInfo) 726 { 727 if (![defaultElementActions count]) 728 return nil; 729 730 auto actions = [NSMutableArray arrayWithCapacity:[defaultElementActions count]]; 731 for (_WKElementAction *elementAction in defaultElementActions.get()) 732 [actions addObject:[elementAction uiActionForElementInfo:elementInfo.get()]]; 733 734 return actions; 735 } 736 737 - (NSArray<UIMenuElement *> *)suggestedActionsForContextMenuWithPositionInformation:(const WebKit::InteractionInformationAtPosition&)positionInformation 738 { 739 auto elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithInteractionInformationAtPosition:positionInformation userInfo:nil]); 740 RetainPtr<NSArray<_WKElementAction *>> defaultActionsFromAssistant = positionInformation.isLink ? [self defaultActionsForLinkSheet:elementInfo.get()] : [self defaultActionsForImageSheet:elementInfo.get()]; 741 return menuElementsFromDefaultActions(defaultActionsFromAssistant, elementInfo); 742 } 743 744 #if ENABLE(DATA_DETECTION) 745 724 746 - (UIContextMenuConfiguration *)contextMenuInteraction:(UIContextMenuInteraction *)interaction configurationForMenuAtLocation:(CGPoint)location 725 747 { … … 778 800 } 779 801 780 static NSArray<UIMenuElement *> *menuElementsFromDefaultActions(RetainPtr<NSArray> defaultElementActions, RetainPtr<_WKActivatedElementInfo> elementInfo)781 {782 if (![defaultElementActions count])783 return nil;784 785 auto actions = [NSMutableArray arrayWithCapacity:[defaultElementActions count]];786 for (_WKElementAction *elementAction in defaultElementActions.get())787 [actions addObject:[elementAction uiActionForElementInfo:elementInfo.get()]];788 789 return actions;790 }791 792 802 - (NSArray<UIMenuElement *> *)_contextMenuInteraction:(UIContextMenuInteraction *)interaction overrideSuggestedActionsForConfiguration:(UIContextMenuConfiguration *)configuration 793 803 { … … 797 807 } 798 808 799 - (NSArray<UIMenuElement *> *)suggestedActionsForContextMenuWithPositionInformation:(const WebKit::InteractionInformationAtPosition&)positionInformation 800 { 801 auto elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithInteractionInformationAtPosition:positionInformation userInfo:nil]); 802 RetainPtr<NSArray<_WKElementAction *>> defaultActionsFromAssistant = positionInformation.isLink ? [self defaultActionsForLinkSheet:elementInfo.get()] : [self defaultActionsForImageSheet:elementInfo.get()]; 803 return menuElementsFromDefaultActions(defaultActionsFromAssistant, elementInfo); 804 805 } 806 807 #endif 809 #endif // ENABLE(DATA_DETECTION) 810 811 #endif // USE(UICONTEXTMENU) 808 812 809 813 - (void)cleanupSheet
Note:
See TracChangeset
for help on using the changeset viewer.