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

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

Issue 821173003: Fix Magic Mouse history swiping bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 11 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
Index: chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h
diff --git a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h
index d60c41770567a70991bc5accc118a436ba20d343..47fe073dff18a04bfcb37d393927d68358ae04a4 100644
--- a/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h
+++ b/chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h
@@ -113,6 +113,18 @@ enum RecognitionState {
// that it can decide whether to consume the events and prevent them from
// being passed to the renderer. This API is used to transition from kPending
// -> kPotential.
+//
+// This class is also responsible for handling gestures from a Magic Mouse.
+// Magic Mouse gestures do not generate -touches*WithEvent: callbacks, so this
+// class must use the API -[NSEvent trackSwipeEventWithOptions:...] to track
+// the Magic Mouse gesture. Due to an AppKit bug, once this API is invoked,
+// views no longer reliable receive -touches*WithEvent: callbacks. As such,
+// once this class invokes the -[NSEvent trackSwipeEventWithOptions:...] API,
+// it must continue to use that API, since it no longer receives touch events.
+//
+// TODO(erikchen): Even for users that do not have a Magic Mouse, this class
+// will sometime transition into Magic Mouse mode. This is very undesirable.
+// See http://crbug.com/317161 for more details.
@class HistoryOverlayController;
@interface HistorySwiper : NSObject {
@private
@@ -149,7 +161,7 @@ enum RecognitionState {
id<HistorySwiperDelegate> delegate_;
// Cumulative scroll delta since scroll gesture start. Only valid during
- // scroll gesture handling. Used for history swiping.
+ // scroll gesture handling. Only used to trigger Magic Mouse history swiping.
NSSize mouseScrollDelta_;
}
@@ -162,10 +174,14 @@ enum RecognitionState {
// The event passed in is a gesture event, and has touch data associated with
// the trackpad.
+// Once the method -[NSEvent trackSwipeEventWithOptions:...] is invoked, the
+// methods -touches*WithEvent: are no longer guaranteed to be called for
+// subsequent gestures. http://crbug.com/317161
- (void)touchesBeganWithEvent:(NSEvent*)event;
- (void)touchesMovedWithEvent:(NSEvent*)event;
- (void)touchesCancelledWithEvent:(NSEvent*)event;
- (void)touchesEndedWithEvent:(NSEvent*)event;
+
- (void)beginGestureWithEvent:(NSEvent*)event;
- (void)endGestureWithEvent:(NSEvent*)event;

Powered by Google App Engine
This is Rietveld 408576698