Mac: Fix history swiping bug on Yosemite.
commit97627459714233ddb254a877760d575c997068b0
authorerikchen <erikchen@chromium.org>
Thu, 25 Sep 2014 21:20:53 +0000 (25 14:20 -0700)
committerCommit bot <commit-bot@chromium.org>
Thu, 25 Sep 2014 21:21:06 +0000 (25 21:21 +0000)
tree5fa85e49b9087c2776a08002ad6aecd664ff3fbe
parentbd050f35257ecb6ae241c7b886c412caefa75327
Mac: Fix history swiping bug on Yosemite.

There are 3 different sets of callbacks generated by AppKit in response to
swipe events. The previous code relied on assumptions about the timing of the
callbacks. It expected to receive the beginGestureWithEvent: callback before
receiving any touchesMovedWithEvent: callbacks. Yosemite AppKit broke this
assumption.

The new code stops using beginGestureWithEvent: except to determine edge cases
associated with the Magic Mouse, thus removing this implicit assumption.

Because history swiping direction is determined very early on in the life cycle
of the gesture, this CL adds some logic to ensure that the direction isn't
determined prematurely.

BUG=414103
TEST=History swiping should work as expected with both magic mouse and
trackpad.

Review URL: https://codereview.chromium.org/600743003

Cr-Commit-Position: refs/heads/master@{#296795}
chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.h
chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper.mm
chrome/browser/renderer_host/chrome_render_widget_host_view_mac_history_swiper_unit_test.mm