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

Unified Diff: ui/views/widget/root_view.cc

Issue 10983008: views: Reset the capture-view at the end of a gesture. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 3 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/views/widget/widget_unittest.cc » ('j') | 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 2dd54462adc2911358140920068d6bbe10d63e84..2db6cb14e13875ca7e933cbbcdb9e20a951a18d8 100644
--- a/ui/views/widget/root_view.cc
+++ b/ui/views/widget/root_view.cc
@@ -469,8 +469,14 @@ ui::EventResult RootView::OnGestureEvent(const ui::GestureEvent& event) {
ui::EventResult status = handler->ProcessGestureEvent(handler_event);
if (event.type() == ui::ET_GESTURE_END &&
- event.details().touch_points() <= 1)
- gesture_handler_ = NULL;
+ event.details().touch_points() <= 1) {
+ // In case a drag was in progress, reset all the handlers. Otherwise, just
+ // reset the gesture handler.
+ if (gesture_handler_ == mouse_pressed_handler_)
+ SetMouseHandler(NULL);
+ else
+ gesture_handler_ = NULL;
+ }
if (scroll_gesture_handler_ && (event.type() == ui::ET_GESTURE_SCROLL_END ||
event.type() == ui::ET_SCROLL_FLING_START))
« no previous file with comments | « no previous file | ui/views/widget/widget_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698