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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
886 default: | 886 default: |
887 NOTREACHED(); | 887 NOTREACHED(); |
888 break; | 888 break; |
889 } | 889 } |
890 | 890 |
891 if (dispatching_held_event_ || !held_move_event_ || | 891 if (dispatching_held_event_ || !held_move_event_ || |
892 !held_move_event_->IsTouchEvent()) { | 892 !held_move_event_->IsTouchEvent()) { |
893 ui::TouchEvent orig_event(*event, target, window()); | 893 ui::TouchEvent orig_event(*event, target, window()); |
894 | 894 |
895 // If the touch event is invalid in some way, the gesture recognizer will | 895 // If the touch event is invalid in some way, the gesture recognizer will |
896 // reject it. In this case, stop the touch from reaching the next event | 896 // reject it. This must call |StopPropagation()|, in order to prevent the |
897 // phase. | 897 // touch from being acked in |PostDispatchEvent|. |
898 if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(orig_event, | 898 if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(orig_event, |
899 target)) { | 899 target)) { |
900 event->SetHandled(); | 900 event->StopPropagation(); |
901 } | 901 } |
902 } | 902 } |
903 | 903 |
904 PreDispatchLocatedEvent(target, event); | 904 PreDispatchLocatedEvent(target, event); |
905 } | 905 } |
906 | 906 |
907 } // namespace aura | 907 } // namespace aura |
OLD | NEW |