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

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: remove-webkit-hack 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
« no previous file with comments | « no previous file | ui/app_list/contents_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 1f669a53bacc7078c7893bbc22170f398f580993..e896d075bf626fde0266ddf10ba5924e2e0afd27 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)
« no previous file with comments | « no previous file | ui/app_list/contents_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698