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

Unified Diff: ash/wm/toplevel_window_event_filter.cc

Issue 10826209: gestures: Generate only either scroll-end or fling-start events at the end of a scroll gesture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: win-fix Created 8 years, 4 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
Index: ash/wm/toplevel_window_event_filter.cc
diff --git a/ash/wm/toplevel_window_event_filter.cc b/ash/wm/toplevel_window_event_filter.cc
index 8d0ee8d38a220e00acce834ab668794968431b25..75a128ab3177b07a516a613934c06a0b7705a279 100644
--- a/ash/wm/toplevel_window_event_filter.cc
+++ b/ash/wm/toplevel_window_event_filter.cc
@@ -149,17 +149,22 @@ ui::GestureStatus ToplevelWindowEventFilter::PreHandleGestureEvent(
break;
}
case ui::ET_GESTURE_SCROLL_END:
- if (!in_gesture_resize_)
- return ui::GESTURE_STATUS_UNKNOWN;
- CompleteDrag(DRAG_COMPLETE, event->flags());
- if (in_move_loop_) {
- quit_closure_.Run();
- in_move_loop_ = false;
+ case ui::ET_SCROLL_FLING_START: {
+ ui::GestureStatus status = ui::GESTURE_STATUS_UNKNOWN;
+ if (in_gesture_resize_) {
+ // If the window was being resized, then just complete the resize.
+ CompleteDrag(DRAG_COMPLETE, event->flags());
+ if (in_move_loop_) {
+ quit_closure_.Run();
+ in_move_loop_ = false;
+ }
+ in_gesture_resize_ = false;
+ status = ui::GESTURE_STATUS_CONSUMED;
}
- in_gesture_resize_ = false;
- break;
- case ui::ET_SCROLL_FLING_START: {
+ if (event->type() == ui::ET_GESTURE_SCROLL_END)
+ return status;
+
int component =
target->delegate()->GetNonClientComponent(event->location());
if (WindowResizer::GetBoundsChangeForWindowComponent(component) == 0)

Powered by Google App Engine
This is Rietveld 408576698