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

Unified Diff: ash/drag_drop/drag_drop_controller.cc

Issue 15889009: ash: Stop propagation of gesture events when drag drop is in progress. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 7 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
« no previous file with comments | « no previous file | ash/drag_drop/drag_drop_controller_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/drag_drop/drag_drop_controller.cc
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index 90d3010d69678311fdfc5a3cc644bbf0b6ea2197..98e41d915c1b04c208a8d26e2b31ac357a60b2e6 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -406,13 +406,17 @@ void DragDropController::OnGestureEvent(ui::GestureEvent* event) {
if (!IsDragDropInProgress())
return;
- // If current drag session was not started by touch, dont process this touch
- // event, but consume it so it does not interfere with current drag session.
- if (current_drag_event_source_ !=
- ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH) {
- event->StopPropagation();
+ // No one else should handle gesture events when in drag drop. Note that it is
+ // not enough to just set ER_HANDLED because the dispatcher only stops
+ // dispatching when the event has ER_CONSUMED. If we just set ER_HANDLED, the
+ // event will still be dispatched to other handlers and we depend on
+ // individual handlers' kindness to not touch events marked ER_HANDLED (not
+ // all handlers are so kind and may cause bugs like crbug.com/236493).
+ event->StopPropagation();
+
+ // If current drag session was not started by touch, dont process this event.
+ if (current_drag_event_source_ != ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH)
return;
- }
// Apply kTouchDragImageVerticalOffset to the location.
ui::GestureEvent touch_offset_event(*event,
« no previous file with comments | « no previous file | ash/drag_drop/drag_drop_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698