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

Issue 2193153002: MacViews: Send Mac scrollWheel NSEvents as ui::ET_SCROLL (ui::ScrollEvent). (Closed)

Created:
4 years, 4 months ago by tapted
Modified:
4 years, 2 months ago
Reviewers:
Avi (use Gerrit), sky
CC:
chromium-reviews, tfarina, tdresser+watch_chromium.org, chrome-apps-syd-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@20160728-MacViews-ScrollLayers
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

MacViews: Send Mac scrollWheel NSEvents as ui::ET_SCROLL (ui::ScrollEvent). 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 Committed: https://crrev.com/b94b06c07b4dada802959a10f8753d3b1a2dcc03 Cr-Commit-Position: refs/heads/master@{#421082}

Patch Set 1 #

Patch Set 2 : rebase #

Patch Set 3 : Mask -> Enum, more tests #

Patch Set 4 : fix compile, self review #

Patch Set 5 : Test is still flaky - exploring some stuff #

Patch Set 6 : Fixed the flakiness \o/ #

Patch Set 7 : Support Widget MouseWheelEvent conversion #

Total comments: 6

Patch Set 8 : 2 comments #

Patch Set 9 : More idiomatic ObjC #

Total comments: 3

Patch Set 10 : NSDictionary subscripting #

Unified diffs Side-by-side diffs Delta from patch set Stats (+431 lines, -35 lines) Patch
M base/mac/sdk_forward_declarations.h View 1 2 3 4 5 6 7 8 9 1 chunk +12 lines, -0 lines 0 comments Download
M content/browser/renderer_host/input/web_input_event_builders_mac_unittest.mm View 1 2 3 4 5 6 7 2 chunks +6 lines, -3 lines 0 comments Download
M ui/events/cocoa/events_mac.mm View 1 2 3 4 5 6 7 2 chunks +43 lines, -4 lines 0 comments Download
M ui/events/cocoa/events_mac_unittest.mm View 1 2 3 4 5 6 7 8 7 chunks +241 lines, -5 lines 0 comments Download
M ui/events/event.h View 1 2 3 2 chunks +5 lines, -0 lines 0 comments Download
M ui/events/event.cc View 1 2 3 4 5 6 7 1 chunk +4 lines, -5 lines 0 comments Download
M ui/events/event_constants.h View 1 2 3 4 5 6 7 1 chunk +19 lines, -0 lines 0 comments Download
M ui/events/event_utils.h View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M ui/events/event_utils.cc View 1 2 3 1 chunk +4 lines, -0 lines 0 comments Download
M ui/events/events_default.cc View 1 2 3 2 chunks +4 lines, -1 line 0 comments Download
M ui/events/events_stub.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M ui/events/test/cocoa_test_event_utils.h View 1 2 3 4 5 1 chunk +8 lines, -6 lines 0 comments Download
M ui/events/test/cocoa_test_event_utils.mm View 1 2 3 4 5 1 chunk +66 lines, -5 lines 0 comments Download
M ui/events/win/events_win.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M ui/events/x/events_x.cc View 1 2 3 1 chunk +2 lines, -1 line 0 comments Download
M ui/views/cocoa/bridged_content_view.mm View 1 1 chunk +2 lines, -2 lines 0 comments Download
M ui/views/controls/scroll_view.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/controls/scroll_view.cc View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download

Messages

Total messages: 51 (42 generated)
tapted
Hi sky, please take a look. (Time for the next instalment of elastic scrolling now ...
4 years, 3 months ago (2016-09-23 06:58:09 UTC) #30
sky
I'm not a good reviewer for the all the mac event changes. Is there someone ...
4 years, 3 months ago (2016-09-23 17:47:09 UTC) #31
tapted
+avi - could you take a look at the Mac Event handling and test event ...
4 years, 2 months ago (2016-09-26 11:12:21 UTC) #38
Avi (use Gerrit)
I'm OK with all the files that you called me out as an owner for. ...
4 years, 2 months ago (2016-09-26 14:41:44 UTC) #39
sky
LGTM
4 years, 2 months ago (2016-09-26 16:42:32 UTC) #40
tapted
On 2016/09/26 14:41:44, Avi wrote: > The rest all look reasonable. I can LG them ...
4 years, 2 months ago (2016-09-27 01:25:29 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2193153002/240001
4 years, 2 months ago (2016-09-27 01:46:49 UTC) #47
commit-bot: I haz the power
Committed patchset #10 (id:240001)
4 years, 2 months ago (2016-09-27 02:16:35 UTC) #49
commit-bot: I haz the power
4 years, 2 months ago (2016-09-27 02:19:08 UTC) #51
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/b94b06c07b4dada802959a10f8753d3b1a2dcc03
Cr-Commit-Position: refs/heads/master@{#421082}

Powered by Google App Engine
This is Rietveld 408576698