Changeset 248353 in webkit
- Timestamp:
- Aug 6, 2019, 11:52:47 PM (7 years ago)
- Location:
- branches/safari-608.1-branch/Source/WebKit
- Files:
-
- 2 edited
-
ChangeLog (modified) (1 diff)
-
UIProcess/ios/WKContentViewInteraction.mm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-608.1-branch/Source/WebKit/ChangeLog
r248352 r248353 1 2019-08-06 Kocsen Chung <kocsen_chung@apple.com> 2 3 Cherry-pick r247920. rdar://problem/54017883 4 5 Contextual menu does not present when holding an embedded photo but works with link and attachments 6 https://bugs.webkit.org/show_bug.cgi?id=200239 7 <rdar://problem/53318733> 8 9 Reviewed by Tim Horton. 10 11 If the user long-pressed on an image, and the client implemented the new API but did 12 not provide a configuration, we were not falling back to the default behaviour of 13 giving a menu allowing the user to copy/share/save the image. 14 15 * UIProcess/ios/WKContentViewInteraction.mm: 16 (-[WKContentView continueContextMenuInteraction:]): If we get through the delegates, 17 and the element is an image, return the default configuration. 18 19 git-svn-id: https://svn.webkit.org/repository/webkit/trunk@247920 268f45cc-cd09-0410-ab3c-d52691b4dbfc 20 21 2019-07-29 Dean Jackson <dino@apple.com> 22 23 Contextual menu does not present when holding an embedded photo but works with link and attachments 24 https://bugs.webkit.org/show_bug.cgi?id=200239 25 <rdar://problem/53318733> 26 27 Reviewed by Tim Horton. 28 29 If the user long-pressed on an image, and the client implemented the new API but did 30 not provide a configuration, we were not falling back to the default behaviour of 31 giving a menu allowing the user to copy/share/save the image. 32 33 * UIProcess/ios/WKContentViewInteraction.mm: 34 (-[WKContentView continueContextMenuInteraction:]): If we get through the delegates, 35 and the element is an image, return the default configuration. 36 1 37 2019-08-06 Kocsen Chung <kocsen_chung@apple.com> 2 38 -
branches/safari-608.1-branch/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm
r248352 r248353 7953 7953 } 7954 7954 7955 if (strongSelf->_positionInformation.isImage) { 7956 ASSERT(strongSelf->_positionInformation.image); 7957 auto cgImage = strongSelf->_positionInformation.image->makeCGImageCopy(); 7958 7959 strongSelf->_contextMenuActionProviderDelegateNeedsOverride = NO; 7960 7961 auto elementInfo = adoptNS([[_WKActivatedElementInfo alloc] _initWithInteractionInformationAtPosition:strongSelf->_positionInformation]); 7962 7963 UIContextMenuActionProvider actionMenuProvider = [weakSelf, elementInfo] (NSArray<UIMenuElement *> *) -> UIMenu * { 7964 auto strongSelf = weakSelf.get(); 7965 if (!strongSelf) 7966 return nil; 7967 7968 RetainPtr<NSArray<_WKElementAction *>> defaultActionsFromAssistant = [strongSelf->_actionSheetAssistant defaultActionsForImageSheet:elementInfo.get()]; 7969 auto actions = menuElementsFromDefaultActions(defaultActionsFromAssistant, elementInfo); 7970 return [UIMenu menuWithTitle:@"" children:actions]; 7971 }; 7972 7973 UIContextMenuContentPreviewProvider contentPreviewProvider = [weakSelf, cgImage, elementInfo] () -> UIViewController * { 7974 auto strongSelf = weakSelf.get(); 7975 if (!strongSelf) 7976 return nil; 7977 7978 return [[WKImagePreviewViewController alloc] initWithCGImage:cgImage defaultActions:nil elementInfo:elementInfo.get()]; 7979 }; 7980 7981 return continueWithContextMenuConfiguration([UIContextMenuConfiguration configurationWithIdentifier:nil previewProvider:contentPreviewProvider actionProvider:actionMenuProvider]); 7982 } 7983 7955 7984 // At this point we have an object we might want to show a context menu for, but the 7956 7985 // client was unable to handle it. Before giving up, we ask DataDetectors.
Note:
See TracChangeset
for help on using the changeset viewer.