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

Side by Side Diff: ui/views/widget/root_view.cc

Issue 619183002: Move check for gesture end events out of RootViewTargeter (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: comment removed Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « ui/views/view_targeter_unittest.cc ('k') | ui/views/widget/root_view_targeter.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/views/widget/root_view.h" 5 #include "ui/views/widget/root_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/message_loop/message_loop.h" 10 #include "base/message_loop/message_loop.h"
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after
254 return; 254 return;
255 255
256 ui::GestureEvent* gesture_event = event->AsGestureEvent(); 256 ui::GestureEvent* gesture_event = event->AsGestureEvent();
257 257
258 // Do not process ui::ET_GESTURE_BEGIN events. 258 // Do not process ui::ET_GESTURE_BEGIN events.
259 if (gesture_event->type() == ui::ET_GESTURE_BEGIN) { 259 if (gesture_event->type() == ui::ET_GESTURE_BEGIN) {
260 event->SetHandled(); 260 event->SetHandled();
261 return; 261 return;
262 } 262 }
263 263
264 // Do not process ui::ET_GESTURE_END events which do not correspond to the 264 // Do not process ui::ET_GESTURE_END events if they do not correspond to the
265 // removal of the final touch point. 265 // removal of the final touch point or if no gesture handler has already
266 // been set.
266 if (gesture_event->type() == ui::ET_GESTURE_END && 267 if (gesture_event->type() == ui::ET_GESTURE_END &&
267 gesture_event->details().touch_points() > 1) { 268 (gesture_event->details().touch_points() > 1 ||
269 !gesture_handler_)) {
268 event->SetHandled(); 270 event->SetHandled();
269 return; 271 return;
270 } 272 }
271 273
272 // Do not process subsequent gesture scroll events if no handler was set for 274 // Do not process subsequent gesture scroll events if no handler was set for
273 // a ui::ET_GESTURE_SCROLL_BEGIN event. 275 // a ui::ET_GESTURE_SCROLL_BEGIN event.
274 if (!gesture_handler_ && 276 if (!gesture_handler_ &&
275 (gesture_event->type() == ui::ET_GESTURE_SCROLL_UPDATE || 277 (gesture_event->type() == ui::ET_GESTURE_SCROLL_UPDATE ||
276 gesture_event->type() == ui::ET_GESTURE_SCROLL_END || 278 gesture_event->type() == ui::ET_GESTURE_SCROLL_END ||
277 gesture_event->type() == ui::ET_SCROLL_FLING_START)) { 279 gesture_event->type() == ui::ET_SCROLL_FLING_START)) {
(...skipping 443 matching lines...) Expand 10 before | Expand all | Expand 10 after
721 723
722 #ifndef NDEBUG 724 #ifndef NDEBUG
723 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_)); 725 DCHECK(!event_dispatch_target_ || Contains(event_dispatch_target_));
724 #endif 726 #endif
725 727
726 return details; 728 return details;
727 } 729 }
728 730
729 } // namespace internal 731 } // namespace internal
730 } // namespace views 732 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/view_targeter_unittest.cc ('k') | ui/views/widget/root_view_targeter.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698