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

Unified Diff: chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm

Issue 117733002: mac: Fix a newly introduced history swiping bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add a forward declaration. Created 7 years 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
Index: chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm
diff --git a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm
index 306ff08451f7509eb86b171e6811e5965c33ea98..8d155990fabf9050a13eee2c173e97edea13a407 100644
--- a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm
+++ b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm
@@ -280,9 +280,18 @@
- (BOOL)maybeHandleHistorySwiping:(NSEvent*)theEvent {
// We've already processed this gesture.
if (lastProcessedGestureId_ == currentGestureId_) {
+ // A new event may come in before it's recognized as a gesture.
+ // We have not yet reset the state from the last gesture.
+ // Let it pass through.
+ if ([theEvent phase] == NSEventPhaseBegan ||
+ [theEvent phase] == NSEventPhaseMayBegin) {
+ return NO;
+ }
+
// The user cancelled the history swiper. Ignore all events.
if (historySwipeCancelled_)
return NO;
+
// The user completed the history swiper. Swallow all events.
return YES;
}

Powered by Google App Engine
This is Rietveld 408576698