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

Unified Diff: ash/drag_drop/drag_drop_controller.cc

Issue 11280290: events: Change gesture-event handler in EventHandler to not return any values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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 | « ash/drag_drop/drag_drop_controller.h ('k') | 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 db0e213ad74b43760f6be1de803845a0b8ee8f57..cf6135e1ecaaecd18a8753b5b89b3ae7c3c9bf5e 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -332,14 +332,17 @@ ui::EventResult DragDropController::OnTouchEvent(ui::TouchEvent* event) {
return ui::ER_UNHANDLED;
}
-ui::EventResult DragDropController::OnGestureEvent(ui::GestureEvent* event) {
+void DragDropController::OnGestureEvent(ui::GestureEvent* event) {
if (!IsDragDropInProgress())
- return ui::ER_UNHANDLED;
+ 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)
- return ui::ER_CONSUMED;
+ if (current_drag_event_source_ !=
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH) {
+ event->StopPropagation();
+ return;
+ }
// Apply kTouchDragImageVerticalOffset to the location.
ui::GestureEvent touch_offset_event(*event,
@@ -356,7 +359,8 @@ ui::EventResult DragDropController::OnGestureEvent(ui::GestureEvent* event) {
drag_drop_tracker_->GetTarget(touch_offset_event);
if (!translated_target) {
DragCancel();
- return ui::ER_HANDLED;
+ event->SetHandled();
+ return;
}
scoped_ptr<ui::LocatedEvent> translated_event(
drag_drop_tracker_->ConvertEvent(translated_target, touch_offset_event));
@@ -384,7 +388,7 @@ ui::EventResult DragDropController::OnGestureEvent(ui::GestureEvent* event) {
default:
break;
}
- return ui::ER_HANDLED;
+ event->SetHandled();
}
void DragDropController::OnWindowDestroyed(aura::Window* window) {
« no previous file with comments | « ash/drag_drop/drag_drop_controller.h ('k') | ash/drag_drop/drag_drop_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698