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 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 ui::MouseEvent event(ui::ET_MOUSE_EXITED, point, point, ui::EF_NONE, | 154 ui::MouseEvent event(ui::ET_MOUSE_EXITED, point, point, ui::EF_NONE, |
155 ui::EF_NONE); | 155 ui::EF_NONE); |
156 return DispatchMouseEnterOrExit(event, ui::ET_MOUSE_EXITED); | 156 return DispatchMouseEnterOrExit(event, ui::ET_MOUSE_EXITED); |
157 } | 157 } |
158 | 158 |
159 void WindowEventDispatcher::ProcessedTouchEvent(ui::TouchEvent* event, | 159 void WindowEventDispatcher::ProcessedTouchEvent(ui::TouchEvent* event, |
160 Window* window, | 160 Window* window, |
161 ui::EventResult result) { | 161 ui::EventResult result) { |
162 // TODO(tdresser): Move this to PreDispatchTouchEvent, to enable eager | 162 // TODO(tdresser): Move this to PreDispatchTouchEvent, to enable eager |
163 // gesture detection. See crbug.com/410280. | 163 // gesture detection. See crbug.com/410280. |
164 if (!ui::GestureRecognizer::Get() | 164 if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch(event, |
165 ->ProcessTouchEventPreDispatch(*event, window)) { | 165 window)) { |
166 return; | 166 return; |
167 } | 167 } |
168 | 168 |
169 // Once we've fully migrated to the eager gesture detector, we won't need to | 169 // Once we've fully migrated to the eager gesture detector, we won't need to |
170 // pass an event here. | 170 // pass an event here. |
171 scoped_ptr<ui::GestureRecognizer::Gestures> gestures( | 171 scoped_ptr<ui::GestureRecognizer::Gestures> gestures( |
172 ui::GestureRecognizer::Get()->ProcessTouchEventOnAsyncAck( | 172 ui::GestureRecognizer::Get()->ProcessTouchEventOnAsyncAck( |
173 *event, result, window)); | 173 *event, result, window)); |
174 DispatchDetails details = ProcessGestures(gestures.get()); | 174 DispatchDetails details = ProcessGestures(gestures.get()); |
175 if (details.dispatcher_destroyed) | 175 if (details.dispatcher_destroyed) |
(...skipping 327 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
503 // need to pass an event here. | 503 // need to pass an event here. |
504 ui::TouchEvent orig_event(static_cast<const ui::TouchEvent&>(event), | 504 ui::TouchEvent orig_event(static_cast<const ui::TouchEvent&>(event), |
505 static_cast<Window*>(event.target()), | 505 static_cast<Window*>(event.target()), |
506 window()); | 506 window()); |
507 | 507 |
508 if (event.result() & ui::ER_CONSUMED) | 508 if (event.result() & ui::ER_CONSUMED) |
509 orig_event.StopPropagation(); | 509 orig_event.StopPropagation(); |
510 | 510 |
511 // TODO(tdresser): Move this to PreDispatchTouchEvent, to enable eager | 511 // TODO(tdresser): Move this to PreDispatchTouchEvent, to enable eager |
512 // gesture detection. See crbug.com/410280. | 512 // gesture detection. See crbug.com/410280. |
513 if (!ui::GestureRecognizer::Get() | 513 if (!ui::GestureRecognizer::Get()->ProcessTouchEventPreDispatch( |
514 ->ProcessTouchEventPreDispatch(orig_event, | 514 &orig_event, static_cast<Window*>(target))) { |
515 static_cast<Window*>(target))) { | |
516 return details; | 515 return details; |
517 } | 516 } |
518 | 517 |
519 scoped_ptr<ui::GestureRecognizer::Gestures> gestures; | 518 scoped_ptr<ui::GestureRecognizer::Gestures> gestures; |
520 | 519 |
521 gestures.reset( | 520 gestures.reset( |
522 ui::GestureRecognizer::Get()->ProcessTouchEventPostDispatch( | 521 ui::GestureRecognizer::Get()->ProcessTouchEventPostDispatch( |
523 orig_event, event.result(), static_cast<Window*>(target))); | 522 orig_event, event.result(), static_cast<Window*>(target))); |
524 | 523 |
525 return ProcessGestures(gestures.get()); | 524 return ProcessGestures(gestures.get()); |
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
898 | 897 |
899 default: | 898 default: |
900 NOTREACHED(); | 899 NOTREACHED(); |
901 break; | 900 break; |
902 } | 901 } |
903 | 902 |
904 PreDispatchLocatedEvent(target, event); | 903 PreDispatchLocatedEvent(target, event); |
905 } | 904 } |
906 | 905 |
907 } // namespace aura | 906 } // namespace aura |
OLD | NEW |