OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |