Commit bff063a0 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS][web] Extract userIsInteracting

Change-Id: I9c6b6e1e11566aea995e4dab7cf22175b2475395
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1584304Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Commit-Queue: Gauthier Ambard <gambard@chromium.org>
Cr-Commit-Position: refs/heads/master@{#654808}
parent 8ce20eb9
...@@ -3845,7 +3845,7 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*); ...@@ -3845,7 +3845,7 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*);
// There is no reliable way to tell if there was a user gesture, so this code // There is no reliable way to tell if there was a user gesture, so this code
// checks if user has recently tapped on web view. TODO(crbug.com/809706): // checks if user has recently tapped on web view. TODO(crbug.com/809706):
// Remove the usage of -userIsInteracting when rdar://19989909 is fixed. // Remove the usage of -userIsInteracting when rdar://19989909 is fixed.
bool initiatedByUser = [self userIsInteracting]; bool initiatedByUser = [self isUserInitiatedAction:action];
if (UIAccessibilityIsVoiceOverRunning()) { if (UIAccessibilityIsVoiceOverRunning()) {
// -userIsInteracting returns NO if VoiceOver is On. Inspect action's // -userIsInteracting returns NO if VoiceOver is On. Inspect action's
...@@ -3965,6 +3965,10 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*); ...@@ -3965,6 +3965,10 @@ typedef void (^ViewportStateCompletion)(const web::PageViewportState*);
#pragma mark - WKUIDelegate Helpers #pragma mark - WKUIDelegate Helpers
- (BOOL)isUserInitiatedAction:(WKNavigationAction*)action {
return [self userIsInteracting];
}
// Helper to respond to |webView:runJavaScript...| delegate methods. // Helper to respond to |webView:runJavaScript...| delegate methods.
// |completionHandler| must not be nil. // |completionHandler| must not be nil.
- (void)runJavaScriptDialogOfType:(web::JavaScriptDialogType)type - (void)runJavaScriptDialogOfType:(web::JavaScriptDialogType)type
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment