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

Issue 1907323003: Drag and drop cleans up touch sequences from the source window. (Closed)

Created:
4 years, 8 months ago by tdresser
Modified:
4 years, 7 months ago
Reviewers:
sadrul, sky
CC:
chromium-reviews, kalyank, sadrul, tdresser+watch_chromium.org, jonross, wjmaclean
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Drag and drop cleans up touch sequences from the source window. Previously we would just leave the source window thinking it had a pointer touching it the whole time, and then when a new pointer came down, we'd ignore that event. This behavior is required for tab drag, but not for drag and drop. This caused problems for OOPIF/webview event targetting. This patch sends cancel events correctly in the drag and drop case. This is a bit tricky, because during drag and drop, we move a gesture recognizer from the source window to the destination window, leaving the source window with no gesture recognition state. To deal with this, we send press events to the gesture recognizer without sending them to the associated window, to get the gesture recognizer state for the source window back in sync with the pointers that are active on it, and then we dispatch cancel events to the source window. Ideally we'd just clone the GR state and then send the cancel events, but cloning the GR state would be painful. The tab drag case is left untouched - when dragging a tab, the source window continues to think that a pointer is down throughout the tab drag, until the finger is raised. BUG=604454 TEST=GestureProviderAuraTest.IgnoresExtraPressEvents, GestureRecognizerTest.PressDoesNotCrash Committed: https://crrev.com/4ab3ab417ec9ddaa3672219ea3dba4e8b35f1518 Cr-Commit-Position: refs/heads/master@{#393568}

Patch Set 1 #

Patch Set 2 : Split up tab drag and drag and drop. #

Patch Set 3 : Fix tests, cleanup. #

Patch Set 4 : Fix another test. #

Total comments: 6

Patch Set 5 : Update GR state without actually dispatching press events. #

Total comments: 2

Patch Set 6 : Add DCHECK. #

Total comments: 1

Patch Set 7 : Merge event transfer methods. #

Patch Set 8 : Replace bool with enum. #

Patch Set 9 : Fix comment. #

Patch Set 10 : More comment fixes. #

Patch Set 11 : Fix Mac. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+139 lines, -88 lines) Patch
M ash/drag_drop/drag_drop_controller.cc View 1 2 3 4 5 6 7 1 chunk +3 lines, -2 lines 0 comments Download
M ash/shelf/shelf_tooltip_manager_unittest.cc View 1 2 3 2 chunks +2 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab_drag_controller.cc View 1 2 3 4 5 6 7 2 chunks +4 lines, -2 lines 0 comments Download
M ui/aura/gestures/gesture_recognizer_unittest.cc View 1 1 chunk +3 lines, -6 lines 0 comments Download
M ui/aura/window_event_dispatcher.h View 1 chunk +1 line, -2 lines 0 comments Download
M ui/aura/window_event_dispatcher.cc View 1 2 3 4 5 1 chunk +3 lines, -4 lines 0 comments Download
M ui/events/gesture_detection/gesture_provider.cc View 1 2 3 4 1 chunk +0 lines, -1 line 0 comments Download
M ui/events/gestures/gesture_provider_aura.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M ui/events/gestures/gesture_provider_aura.cc View 1 2 3 4 2 chunks +13 lines, -0 lines 0 comments Download
M ui/events/gestures/gesture_provider_aura_unittest.cc View 1 1 chunk +1 line, -5 lines 0 comments Download
M ui/events/gestures/gesture_recognizer.h View 1 2 3 4 5 6 7 8 9 1 chunk +8 lines, -6 lines 0 comments Download
M ui/events/gestures/gesture_recognizer_impl.h View 1 2 3 4 5 6 7 1 chunk +8 lines, -1 line 0 comments Download
M ui/events/gestures/gesture_recognizer_impl.cc View 1 2 3 4 5 6 7 8 9 3 chunks +79 lines, -35 lines 0 comments Download
M ui/events/gestures/gesture_recognizer_impl_mac.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -1 line 0 comments Download
M ui/events/gestures/gesture_types.h View 1 chunk +1 line, -2 lines 0 comments Download
M ui/events/gestures/motion_event_aura.cc View 1 2 3 4 1 chunk +5 lines, -16 lines 0 comments Download
M ui/events/gestures/motion_event_aura_unittest.cc View 1 2 4 chunks +5 lines, -5 lines 0 comments Download

Messages

Total messages: 56 (23 generated)
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1907323003/1 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1907323003/1
4 years, 8 months ago (2016-04-22 20:35:56 UTC) #2
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_rel_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_rel_ng/builds/201628)
4 years, 8 months ago (2016-04-22 21:21:58 UTC) #4
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1907323003/20001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1907323003/20001
4 years, 7 months ago (2016-04-29 14:45:12 UTC) #6
tdresser
Sadrul, does this seem reasonable?
4 years, 7 months ago (2016-04-29 14:52:16 UTC) #9
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: linux_chromium_chromeos_compile_dbg_ng on tryserver.chromium.linux (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.linux/builders/linux_chromium_chromeos_compile_dbg_ng/builds/193433)
4 years, 7 months ago (2016-04-29 15:03:35 UTC) #11
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1907323003/40001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1907323003/40001
4 years, 7 months ago (2016-04-29 16:43:25 UTC) #13
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: win_chromium_rel_ng on tryserver.chromium.win (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.win/builders/win_chromium_rel_ng/builds/214007)
4 years, 7 months ago (2016-04-29 17:24:29 UTC) #15
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1907323003/60001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1907323003/60001
4 years, 7 months ago (2016-04-29 18:05:08 UTC) #17
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-04-29 19:13:02 UTC) #19
tdresser
Ping.
4 years, 7 months ago (2016-05-02 13:20:30 UTC) #20
sadrul
> This patch provides this extra state on > demand, sending press events through directly ...
4 years, 7 months ago (2016-05-02 14:10:13 UTC) #21
tdresser
Thanks, that CL description was somewhat out of sync with the state of the code. ...
4 years, 7 months ago (2016-05-02 14:19:50 UTC) #23
tdresser
Ping - this is a stable blocker, and we've already branched, so I'm trying to ...
4 years, 7 months ago (2016-05-03 13:08:49 UTC) #24
sadrul
https://codereview.chromium.org/1907323003/diff/60001/ui/events/gestures/gesture_recognizer.h File ui/events/gestures/gesture_recognizer.h (right): https://codereview.chromium.org/1907323003/diff/60001/ui/events/gestures/gesture_recognizer.h#newcode74 ui/events/gestures/gesture_recognizer.h:74: virtual void BeginTabDrag(GestureConsumer* current_consumer, GR is a fairly low-level ...
4 years, 7 months ago (2016-05-03 18:38:16 UTC) #25
tdresser
https://codereview.chromium.org/1907323003/diff/60001/ui/events/gestures/gesture_recognizer.h File ui/events/gestures/gesture_recognizer.h (right): https://codereview.chromium.org/1907323003/diff/60001/ui/events/gestures/gesture_recognizer.h#newcode74 ui/events/gestures/gesture_recognizer.h:74: virtual void BeginTabDrag(GestureConsumer* current_consumer, On 2016/05/03 18:38:16, sadrul wrote: ...
4 years, 7 months ago (2016-05-03 18:56:42 UTC) #26
sadrul
https://codereview.chromium.org/1907323003/diff/60001/ui/events/gestures/gesture_recognizer.h File ui/events/gestures/gesture_recognizer.h (right): https://codereview.chromium.org/1907323003/diff/60001/ui/events/gestures/gesture_recognizer.h#newcode74 ui/events/gestures/gesture_recognizer.h:74: virtual void BeginTabDrag(GestureConsumer* current_consumer, On 2016/05/03 18:56:42, tdresser wrote: ...
4 years, 7 months ago (2016-05-04 13:28:18 UTC) #27
tdresser
4 years, 7 months ago (2016-05-09 19:26:37 UTC) #29
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1907323003/80001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1907323003/80001
4 years, 7 months ago (2016-05-09 19:27:13 UTC) #30
commit-bot: I haz the power
Dry run: This issue passed the CQ dry run.
4 years, 7 months ago (2016-05-09 21:32:57 UTC) #33
tdresser
+sky@ for: chrome/browser/ui/views/tabs/tab_drag_controller.cc ash/shelf/shelf_tooltip_manager_unittest.cc ash/drag_drop/drag_drop_controller.cc
4 years, 7 months ago (2016-05-10 12:12:49 UTC) #35
sadrul
lgtm https://codereview.chromium.org/1907323003/diff/80001/ui/aura/window_event_dispatcher.cc File ui/aura/window_event_dispatcher.cc (right): https://codereview.chromium.org/1907323003/diff/80001/ui/aura/window_event_dispatcher.cc#newcode534 ui/aura/window_event_dispatcher.cc:534: // in raw pixels, so we convert back ...
4 years, 7 months ago (2016-05-11 16:12:17 UTC) #36
tdresser
https://codereview.chromium.org/1907323003/diff/80001/ui/aura/window_event_dispatcher.cc File ui/aura/window_event_dispatcher.cc (right): https://codereview.chromium.org/1907323003/diff/80001/ui/aura/window_event_dispatcher.cc#newcode534 ui/aura/window_event_dispatcher.cc:534: // in raw pixels, so we convert back to ...
4 years, 7 months ago (2016-05-11 16:32:31 UTC) #37
sky
https://codereview.chromium.org/1907323003/diff/100001/ui/events/gestures/gesture_recognizer.h File ui/events/gestures/gesture_recognizer.h (right): https://codereview.chromium.org/1907323003/diff/100001/ui/events/gestures/gesture_recognizer.h#newcode74 ui/events/gestures/gesture_recognizer.h:74: virtual void BeginTabDrag(GestureConsumer* current_consumer, This code sits lower in ...
4 years, 7 months ago (2016-05-12 15:43:34 UTC) #38
tdresser
On 2016/05/12 15:43:34, sky wrote: > https://codereview.chromium.org/1907323003/diff/100001/ui/events/gestures/gesture_recognizer.h > File ui/events/gestures/gesture_recognizer.h (right): > > https://codereview.chromium.org/1907323003/diff/100001/ui/events/gestures/gesture_recognizer.h#newcode74 > ...
4 years, 7 months ago (2016-05-12 16:27:51 UTC) #39
sky
IMO that both Sadrul and myself pointed this out is an indication we both expect ...
4 years, 7 months ago (2016-05-12 17:54:32 UTC) #40
tdresser
Done.
4 years, 7 months ago (2016-05-12 20:29:54 UTC) #42
sky
Thanks, LGTM - although I would be inclined to go with an enum as it's ...
4 years, 7 months ago (2016-05-12 21:55:53 UTC) #43
tdresser
Switched to enum.
4 years, 7 months ago (2016-05-13 14:32:33 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1907323003/200001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1907323003/200001
4 years, 7 months ago (2016-05-13 14:32:52 UTC) #47
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_gn_rel on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_gn_rel/builds/110739)
4 years, 7 months ago (2016-05-13 14:56:20 UTC) #49
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1907323003/220001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1907323003/220001
4 years, 7 months ago (2016-05-13 15:22:26 UTC) #52
commit-bot: I haz the power
Committed patchset #11 (id:220001)
4 years, 7 months ago (2016-05-13 17:40:26 UTC) #54
commit-bot: I haz the power
4 years, 7 months ago (2016-05-13 17:41:30 UTC) #56
Message was sent while issue was closed.
Patchset 11 (id:??) landed as
https://crrev.com/4ab3ab417ec9ddaa3672219ea3dba4e8b35f1518
Cr-Commit-Position: refs/heads/master@{#393568}

Powered by Google App Engine
This is Rietveld 408576698