⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 280603 in webkit


Ignore:
Timestamp:
Aug 3, 2021, 11:22:46 AM (5 years ago)
Author:
Devin Rousso
Message:

[Live Text] [iOS] Provide a presenting UIViewController for machine readable code actions so that they are related to the same view
https://bugs.webkit.org/show_bug.cgi?id=228722

Reviewed by Tim Horton.

Source/WebCore/PAL:

  • pal/spi/cocoa/VisionKitCoreSPI.h:

Source/WebKit:

  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView _updateContextMenuForMachineReadableCodeForImageAnalysis:]): Added.
(-[WKContentView imageAnalysisGestureDidBegin:]):
(-[WKContentView imageAnalysisGestureDidTimeOut:]):

Location:
trunk/Source
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/PAL/ChangeLog

    r280558 r280603  
     12021-08-03  Devin Rousso  <drousso@apple.com>
     2
     3        [Live Text] [iOS] Provide a presenting `UIViewController` for machine readable code actions so that they are related to the same view
     4        https://bugs.webkit.org/show_bug.cgi?id=228722
     5
     6        Reviewed by Tim Horton.
     7
     8        * pal/spi/cocoa/VisionKitCoreSPI.h:
     9
    1102021-08-02  Devin Rousso  <drousso@apple.com>
    211
  • trunk/Source/WebCore/PAL/pal/spi/cocoa/VisionKitCoreSPI.h

    r280558 r280603  
    131131#if HAVE(VK_IMAGE_ANALYSIS_FOR_MACHINE_READABLE_CODES)
    132132@property (nonatomic) UIMenu *mrcMenu;
     133@property (nonatomic, nullable, weak) UIViewController *presentingViewControllerForMrcAction;
    133134#endif
    134135@end
  • trunk/Source/WebKit/ChangeLog

    r280576 r280603  
     12021-08-03  Devin Rousso  <drousso@apple.com>
     2
     3        [Live Text] [iOS] Provide a presenting `UIViewController` for machine readable code actions so that they are related to the same view
     4        https://bugs.webkit.org/show_bug.cgi?id=228722
     5
     6        Reviewed by Tim Horton.
     7
     8        * UIProcess/ios/WKContentViewInteraction.mm:
     9        (-[WKContentView _updateContextMenuForMachineReadableCodeForImageAnalysis:]): Added.
     10        (-[WKContentView imageAnalysisGestureDidBegin:]):
     11        (-[WKContentView imageAnalysisGestureDidTimeOut:]):
     12
    1132021-08-02  Peng Liu  <peng.liu6@apple.com>
    214
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r280558 r280603  
    1015710157}
    1015810158
     10159#if USE(UICONTEXTMENU) && ENABLE(IMAGE_ANALYSIS_FOR_MACHINE_READABLE_CODES)
     10160
     10161- (void)_updateContextMenuForMachineReadableCodeForImageAnalysis:(VKImageAnalysis *)analysis
     10162{
     10163    analysis.presentingViewControllerForMrcAction = [UIViewController _viewControllerForFullScreenPresentationFromView:self];
     10164    _contextMenuForMachineReadableCode = [analysis hasResultsForAnalysisTypes:VKAnalysisTypeMachineReadableCode | VKAnalysisTypeAppClip] ? analysis.mrcMenu : nil;
     10165}
     10166
     10167#endif // USE(UICONTEXTMENU) && ENABLE(IMAGE_ANALYSIS_FOR_MACHINE_READABLE_CODES)
     10168
    1015910169- (BOOL)validateImageAnalysisRequestIdentifier:(WebKit::ImageAnalysisRequestIdentifier)identifier
    1016010170{
     
    1032410334#endif
    1032510335#if USE(UICONTEXTMENU) && ENABLE(IMAGE_ANALYSIS_FOR_MACHINE_READABLE_CODES)
    10326                     strongSelf->_contextMenuForMachineReadableCode = [result hasResultsForAnalysisTypes:VKAnalysisTypeMachineReadableCode | VKAnalysisTypeAppClip] ? result.mrcMenu : nil;
     10336                    [strongSelf _updateContextMenuForMachineReadableCodeForImageAnalysis:result];
    1032710337#endif // USE(UICONTEXTMENU) && ENABLE(IMAGE_ANALYSIS_FOR_MACHINE_READABLE_CODES)
    1032810338                    [strongSelf _invokeAllActionsToPerformAfterPendingImageAnalysis:WebKit::ProceedWithTextSelectionInImage::No];
     
    1039310403#if USE(UICONTEXTMENU)
    1039410404#if ENABLE(IMAGE_ANALYSIS_FOR_MACHINE_READABLE_CODES)
    10395             strongSelf->_contextMenuForMachineReadableCode = [result hasResultsForAnalysisTypes:VKAnalysisTypeMachineReadableCode | VKAnalysisTypeAppClip] ? result.mrcMenu : nil;
     10405            [strongSelf _updateContextMenuForMachineReadableCodeForImageAnalysis:result];
    1039610406#endif // ENABLE(IMAGE_ANALYSIS_FOR_MACHINE_READABLE_CODES)
    1039710407            strongSelf->_contextMenuWasTriggeredByImageAnalysisTimeout = YES;
Note: See TracChangeset for help on using the changeset viewer.