Changeset 244296 in webkit


Ignore:
Timestamp:
Apr 15, 2019 2:58:08 PM (5 years ago)
Author:
dino@apple.com
Message:

Provide option to not create a longpress gesture recognizer
https://bugs.webkit.org/show_bug.cgi?id=196937
<rdar://problem/49918278>

Reviewed by Antoine Quint.

A WebKitAdditions file has changed name to WKContentViewInteractionWKInteraction.mm.

Add a property to toggle if we should add a long press gesture
recognizer.

  • UIProcess/ios/WKContentViewInteraction.h:
  • UIProcess/ios/WKContentViewInteraction.mm:

(-[WKContentView setupInteraction]):
(shouldUsePreviewForLongPress):
(-[WKContentView shouldUsePreviewForLongPress]):

Location:
trunk/Source/WebKit
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebKit/ChangeLog

    r244292 r244296  
     12019-04-15  Dean Jackson  <dino@apple.com>
     2
     3        Provide option to not create a longpress gesture recognizer
     4        https://bugs.webkit.org/show_bug.cgi?id=196937
     5        <rdar://problem/49918278>
     6
     7        Reviewed by Antoine Quint.
     8
     9        A WebKitAdditions file has changed name to WKContentViewInteractionWKInteraction.mm.
     10
     11        Add a property to toggle if we should add a long press gesture
     12        recognizer.
     13
     14        * UIProcess/ios/WKContentViewInteraction.h:
     15        * UIProcess/ios/WKContentViewInteraction.mm:
     16        (-[WKContentView setupInteraction]):
     17        (shouldUsePreviewForLongPress):
     18        (-[WKContentView shouldUsePreviewForLongPress]):
     19
    1202019-04-15  Don Olmstead  <don.olmstead@sony.com>
    221
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.h

    r244220 r244296  
    503503@interface WKContentView (WKInteractionPreview) <UIPreviewItemDelegate>
    504504
     505@property (nonatomic, readonly) BOOL shouldUsePreviewForLongPress;
     506
    505507- (void)_registerPreview;
    506508- (void)_unregisterPreview;
     509
    507510@end
    508511#endif
  • trunk/Source/WebKit/UIProcess/ios/WKContentViewInteraction.mm

    r244220 r244296  
    743743    [self addGestureRecognizer:_highlightLongPressGestureRecognizer.get()];
    744744
    745     [self _createAndConfigureLongPressGestureRecognizer];
     745    if (!self.shouldUsePreviewForLongPress)
     746        [self _createAndConfigureLongPressGestureRecognizer];
    746747
    747748#if ENABLE(DATA_INTERACTION)
     
    17001701}
    17011702
    1702 #if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKContentViewInteraction.mm>)
    1703 #include <WebKitAdditions/WKContentViewInteraction.mm>
     1703#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKContentViewInteractionWKInteraction.mm>)
     1704#include <WebKitAdditions/WKContentViewInteractionWKInteraction.mm>
    17041705#else
    17051706
     
    71307131@implementation WKContentView (WKInteractionPreview)
    71317132
     7133#if USE(APPLE_INTERNAL_SDK) && __has_include(<WebKitAdditions/WKInteractionPreviewAdditions.mm>)
     7134#include <WebKitAdditions/WKInteractionPreviewAdditions.mm>
     7135#else
     7136static BOOL shouldUsePreviewForLongPress()
     7137{
     7138    return NO;
     7139}
     7140#endif
     7141
     7142- (BOOL)shouldUsePreviewForLongPress
     7143{
     7144    return shouldUsePreviewForLongPress();
     7145}
     7146
    71327147- (void)_registerPreview
    71337148{
Note: See TracChangeset for help on using the changeset viewer.