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

Unified Diff: ash/wm/toplevel_window_event_handler.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/wm/toplevel_window_event_handler.h ('k') | ash/wm/user_activity_detector.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/toplevel_window_event_handler.cc
diff --git a/ash/wm/toplevel_window_event_handler.cc b/ash/wm/toplevel_window_event_handler.cc
index 4f5ad28f44337b50f1ee1b37b843bbe7b93f4505..db7acb4daf490478300437067375ab3a9628e8eb 100644
--- a/ash/wm/toplevel_window_event_handler.cc
+++ b/ash/wm/toplevel_window_event_handler.cc
@@ -156,11 +156,10 @@ ui::EventResult ToplevelWindowEventHandler::OnMouseEvent(
return ui::ER_UNHANDLED;
}
-ui::EventResult ToplevelWindowEventHandler::OnGestureEvent(
- ui::GestureEvent* event) {
+void ToplevelWindowEventHandler::OnGestureEvent(ui::GestureEvent* event) {
aura::Window* target = static_cast<aura::Window*>(event->target());
if (!target->delegate())
- return ui::ER_UNHANDLED;
+ return;
switch (event->type()) {
case ui::ET_GESTURE_SCROLL_BEGIN: {
@@ -168,7 +167,7 @@ ui::EventResult ToplevelWindowEventHandler::OnGestureEvent(
target->delegate()->GetNonClientComponent(event->location());
if (WindowResizer::GetBoundsChangeForWindowComponent(component) == 0) {
window_resizer_.reset();
- return ui::ER_UNHANDLED;
+ return;
}
in_gesture_drag_ = true;
gfx::Point location_in_parent(
@@ -178,14 +177,14 @@ ui::EventResult ToplevelWindowEventHandler::OnGestureEvent(
}
case ui::ET_GESTURE_SCROLL_UPDATE: {
if (!in_gesture_drag_)
- return ui::ER_UNHANDLED;
+ return;
HandleDrag(target, event);
break;
}
case ui::ET_GESTURE_SCROLL_END:
case ui::ET_SCROLL_FLING_START: {
if (!in_gesture_drag_)
- return ui::ER_UNHANDLED;
+ return;
CompleteDrag(DRAG_COMPLETE, event->flags());
if (in_move_loop_) {
@@ -194,15 +193,17 @@ ui::EventResult ToplevelWindowEventHandler::OnGestureEvent(
}
in_gesture_drag_ = false;
- if (event->type() == ui::ET_GESTURE_SCROLL_END)
- return ui::ER_CONSUMED;
+ if (event->type() == ui::ET_GESTURE_SCROLL_END) {
+ event->StopPropagation();
+ return;
+ }
int component =
target->delegate()->GetNonClientComponent(event->location());
if (WindowResizer::GetBoundsChangeForWindowComponent(component) == 0)
- return ui::ER_UNHANDLED;
+ return;
if (!wm::IsWindowNormal(target))
- return ui::ER_UNHANDLED;
+ return;
if (fabs(event->details().velocity_y()) >
kMinVertVelocityForWindowMinimize) {
@@ -225,10 +226,10 @@ ui::EventResult ToplevelWindowEventHandler::OnGestureEvent(
break;
}
default:
- return ui::ER_UNHANDLED;
+ return;
}
- return ui::ER_CONSUMED;
+ event->StopPropagation();
}
aura::client::WindowMoveResult ToplevelWindowEventHandler::RunMoveLoop(
« no previous file with comments | « ash/wm/toplevel_window_event_handler.h ('k') | ash/wm/user_activity_detector.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698