Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(401)

Unified Diff: ios/web/web_state/ui/crw_web_controller.mm

Issue 2764033005: Do not launch external apps while page is scrolling (Closed)
Patch Set: updated comment Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ios/web/web_state/ui/crw_web_controller.mm
diff --git a/ios/web/web_state/ui/crw_web_controller.mm b/ios/web/web_state/ui/crw_web_controller.mm
index 4452fed22046f6e61a63a78c8d0c5e3b4c7b6357..4a51fe0ab9c736797dd064c1accf28dad62ab408 100644
--- a/ios/web/web_state/ui/crw_web_controller.mm
+++ b/ios/web/web_state/ui/crw_web_controller.mm
@@ -3006,14 +3006,14 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
BOOL isNavigationTypeLinkActivated =
action.navigationType == WKNavigationTypeLinkActivated;
- // Check if the link navigation leads to a launch of an external app.
+ // Checks if the link navigation leads to a launch of an external app.
+ // TODO(crbug.com/704417): External apps will not be launched from clicking
+ // a Bookmarked URL or a Recently Closed URL.
// TODO(crbug.com/607780): Revise the logic of allowing external app launch
// and move it to externalAppLauncher.
BOOL isOpenInNewTabNavigation = !(self.navigationManagerImpl->GetItemCount());
BOOL isPossibleLinkClick = [self isLinkNavigation:action.navigationType];
- if (isPossibleLinkClick || isOpenInNewTabNavigation ||
- PageTransitionCoreTypeIs(self.currentTransition,
- ui::PAGE_TRANSITION_AUTO_BOOKMARK)) {
+ if (isPossibleLinkClick || isOpenInNewTabNavigation) {
web::NavigationItem* item = self.currentNavItem;
const GURL currentNavigationURL =
item ? item->GetVirtualURL() : GURL::EmptyGURL();
@@ -3382,6 +3382,13 @@ const NSTimeInterval kSnapshotOverlayTransition = 0.5;
}
- (BOOL)userClickedRecently {
+ // Scrolling generates a pair of touch on/off event which causes
+ // _lastUserInteraction to register that there was user interaction.
+ // Checks for scrolling first to override time-based click heuristics.
+ BOOL scrolling = [[self webScrollView] isDragging] ||
+ [[self webScrollView] isDecelerating];
+ if (scrolling)
+ return NO;
if (!_lastUserInteraction)
return NO;
return _clickInProgress ||
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698