forked from chromium/chromium
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
MacViews: Send Mac scrollWheel NSEvents as ui::ET_SCROLL (ui::ScrollE…
…vent). On Mac, mouse wheel ticks and two-finger trackpad scroll events both arrive via -[NSView scrollWheel:]. These are currently converted to a ui::MouseWheel. However, ui::MouseWheel doesn't have the necessary event phase information that the cc::InputHandler needs to properly calculate scroll elasticity. ui::ScrollEvent is a closer fit, but Mac generates a continuous event "stream" through the momentum portion of a scroll "flick". To support this, add an EventMomentumPhase enum, and populate the ScrollEvent with it. EventMomentumPhase is a simplified representation of the phase information on the native NSEvent: it hides states that don't matter to the scrolling machinery for the cc::InputHandler (i.e. cc::LayerTreeHostImpl). Elastic scrolling overview CL: http://crrev.com/2189583004 Add test coverage by fleshing out cocoa_test_event_utils:: TestScrollEvent(..). Fixes possible flakiness in tests using that method since it didn't previously set event flags explicitly to zero. The result could be that NSEvent uses the current global keyboard state to populate its event flags, which could be influenced by tests running in parallel. BUG=355659, 615948, 640457 Review-Url: https://codereview.chromium.org/2193153002 Cr-Commit-Position: refs/heads/master@{#421082}
- Loading branch information
Showing
18 changed files
with
431 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.