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

Side by Side Diff: ui/aura/window_event_dispatcher.cc

Issue 332703003: aura: Allow held touch-events to contribute to gesture events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 6 years, 6 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | ui/aura/window_event_dispatcher_unittest.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/aura/window_event_dispatcher.h" 5 #include "ui/aura/window_event_dispatcher.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/debug/trace_event.h" 8 #include "base/debug/trace_event.h"
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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 DispatchDetails details; 463 DispatchDetails details;
464 if (!target || target != event_dispatch_target_) 464 if (!target || target != event_dispatch_target_)
465 details.target_destroyed = true; 465 details.target_destroyed = true;
466 event_dispatch_target_ = old_dispatch_target_; 466 event_dispatch_target_ = old_dispatch_target_;
467 old_dispatch_target_ = NULL; 467 old_dispatch_target_ = NULL;
468 #ifndef NDEBUG 468 #ifndef NDEBUG
469 DCHECK(!event_dispatch_target_ || window()->Contains(event_dispatch_target_)); 469 DCHECK(!event_dispatch_target_ || window()->Contains(event_dispatch_target_));
470 #endif 470 #endif
471 471
472 if (event.IsTouchEvent() && !details.target_destroyed) { 472 if (event.IsTouchEvent() && !details.target_destroyed) {
473 // Do not let 'held' touch events contribute to any gestures. 473 // Do not let 'held' touch events contribute to any gestures unless it is
474 if (!held_move_event_ || !held_move_event_->IsTouchEvent()) { 474 // being dispatched.
475 if (dispatching_held_event_ || !held_move_event_ ||
476 !held_move_event_->IsTouchEvent()) {
475 ui::TouchEvent orig_event(static_cast<const ui::TouchEvent&>(event), 477 ui::TouchEvent orig_event(static_cast<const ui::TouchEvent&>(event),
476 static_cast<Window*>(event.target()), window()); 478 static_cast<Window*>(event.target()), window());
477 // Get the list of GestureEvents from GestureRecognizer. 479 // Get the list of GestureEvents from GestureRecognizer.
478 scoped_ptr<ui::GestureRecognizer::Gestures> gestures; 480 scoped_ptr<ui::GestureRecognizer::Gestures> gestures;
479 gestures.reset(ui::GestureRecognizer::Get()-> 481 gestures.reset(ui::GestureRecognizer::Get()->
480 ProcessTouchEventForGesture(orig_event, event.result(), 482 ProcessTouchEventForGesture(orig_event, event.result(),
481 static_cast<Window*>(target))); 483 static_cast<Window*>(target)));
482 return ProcessGestures(gestures.get()); 484 return ProcessGestures(gestures.get());
483 } 485 }
484 } 486 }
(...skipping 356 matching lines...) Expand 10 before | Expand all | Expand 10 after
841 break; 843 break;
842 844
843 default: 845 default:
844 NOTREACHED(); 846 NOTREACHED();
845 break; 847 break;
846 } 848 }
847 PreDispatchLocatedEvent(target, event); 849 PreDispatchLocatedEvent(target, event);
848 } 850 }
849 851
850 } // namespace aura 852 } // namespace aura
OLDNEW
« no previous file with comments | « no previous file | ui/aura/window_event_dispatcher_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698