Changeset 247920 in webkit
- Timestamp:
- Jul 29, 2019, 2:19:41 PM (7 years ago)
- Location:
- trunk/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/ios/WKContentViewInteraction.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebKit/ChangeLog
r247918 r247920 1 2019-07-29 Dean Jackson <dino@apple.com> 2 3 Contextual menu does not present when holding an embedded photo but works with link and attachments 4 https://bugs.webkit.org/show_bug.cgi?id=200239 5 <rdar://problem/53318733> 6 7 Reviewed by Tim Horton. 8 9 If the user long-pressed on an image, and the client implemented the new API but did 10 not provide a configuration, we were not falling back to the default behaviour of 11 giving a menu allowing the user to copy/share/save the image. 12 13 * UIProcess/ios/WKContentViewInteraction.mm: 14 (-[WKContentView continueContextMenuInteraction:]): If we get through the delegates, 15 and the element is an image, return the default configuration. 16 1 17 2019-07-29 Chris Dumez <cdumez@apple.com> 2 18 -
trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r247914 r247920 7964 7964 } 7965 7965 7966 if (strongSelf->_positionInformation.isImage) { 7967 ASSERT(strongSelf->_positionInformation.image); 7968 auto cgImage = strongSelf->_positionInformation.image->makeCGImageCopy(); 7969 7970 strongSelf->_contextMenuActionProviderDelegateNeedsOverride = NO; 7971 7972 auto elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithInteractionInformationAtPosition:strongSelf->_positionInformation]); 7973 7974 UIContextMenuActionProvider actionMenuProvider = [weakSelf, elementInfo] (NSArray<UIMenuElement *> *) -> UIMenu * { 7975 auto strongSelf = weakSelf.get(); 7976 if (!strongSelf) 7977 return nil; 7978 7979 RetainPtr<NSArray<_WKElementAction *>> defaultActionsFromAssistant = [strongSelf->_actionSheetAssistant defaultActionsForImageSheet:elementInfo.get()]; 7980 auto actions = menuElementsFromDefaultActions(defaultActionsFromAssistant, elementInfo); 7981 return [UIMenu menuWithTitle:@"" children:actions]; 7982 }; 7983 7984 UIContextMenuContentPreviewProvider contentPreviewProvider = [weakSelf, cgImage, elementInfo] () -> UIViewController * { 7985 auto strongSelf = weakSelf.get(); 7986 if (!strongSelf) 7987 return nil; 7988 7989 return [[WKImagePreviewViewController alloc] initWithCGImage:cgImage defaultActions:nil elementInfo:elementInfo.get()]; 7990 }; 7991 7992 return continueWithContextMenuConfiguration([UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:contentPreviewProvider actionProvider:actionMenuProvider]); 7993 } 7994 7966 7995 // At this point we have an object we might want to show a context menu for, but the 7967 7996 // client was unable to handle it. Before giving up, we ask DataDetectors.
Note:
See TracChangeset
for help on using the changeset viewer.