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

Unified Diff: ui/views/widget/root_view.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 | « ui/views/events/event.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/widget/root_view.cc
diff --git a/ui/views/widget/root_view.cc b/ui/views/widget/root_view.cc
index 2e799a8f2324b16b68e29a426cbc8beb5646d2c9..c5a72e4802babe127cb3599862c096f5b9cf8e99 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -458,8 +458,9 @@ ui::GestureStatus RootView::OnGestureEvent(const GestureEvent& event) {
if (gesture_handler_) {
// |gesture_handler_| (or |scroll_gesture_handler_|) can be deleted during
// processing.
- View* handler = event.IsScrollGestureEvent() && scroll_gesture_handler_ ?
- scroll_gesture_handler_ : gesture_handler_;
+ View* handler = scroll_gesture_handler_ &&
+ (event.IsScrollGestureEvent() || event.IsFlingScrollEvent()) ?
+ scroll_gesture_handler_ : gesture_handler_;
GestureEvent handler_event(event, this, handler);
ui::GestureStatus status = handler->ProcessGestureEvent(handler_event);
@@ -468,7 +469,8 @@ ui::GestureStatus RootView::OnGestureEvent(const GestureEvent& event) {
event.details().touch_points() <= 1)
gesture_handler_ = NULL;
- if (event.type() == ui::ET_GESTURE_SCROLL_END && scroll_gesture_handler_)
+ if (scroll_gesture_handler_ && (event.type() == ui::ET_GESTURE_SCROLL_END ||
+ event.type() == ui::ET_SCROLL_FLING_START))
scroll_gesture_handler_ = NULL;
if (status == ui::GESTURE_STATUS_CONSUMED)
« no previous file with comments | « ui/views/events/event.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698