| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 } | 173 } |
| 174 | 174 |
| 175 DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint( | 175 DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint( |
| 176 Window* window, | 176 Window* window, |
| 177 const gfx::Point& point) { | 177 const gfx::Point& point) { |
| 178 ui::MouseEvent event(ui::ET_MOUSE_EXITED, point, point, ui::EventTimeForNow(), | 178 ui::MouseEvent event(ui::ET_MOUSE_EXITED, point, point, ui::EventTimeForNow(), |
| 179 ui::EF_NONE, ui::EF_NONE); | 179 ui::EF_NONE, ui::EF_NONE); |
| 180 return DispatchMouseEnterOrExit(window, event, ui::ET_MOUSE_EXITED); | 180 return DispatchMouseEnterOrExit(window, event, ui::ET_MOUSE_EXITED); |
| 181 } | 181 } |
| 182 | 182 |
| 183 void WindowEventDispatcher::ProcessedTouchEvent( | 183 void WindowEventDispatcher::ProcessedTouchEvent(uint32_t unique_event_id, |
| 184 uint32_t unique_event_id, | 184 Window* window, |
| 185 Window* window, | 185 ui::EventResult result) { |
| 186 ui::EventResult result, | |
| 187 bool is_source_touch_event_set_non_blocking) { | |
| 188 ui::GestureRecognizer::Gestures gestures = | 186 ui::GestureRecognizer::Gestures gestures = |
| 189 ui::GestureRecognizer::Get()->AckTouchEvent( | 187 ui::GestureRecognizer::Get()->AckTouchEvent(unique_event_id, result, |
| 190 unique_event_id, result, is_source_touch_event_set_non_blocking, | 188 window); |
| 191 window); | |
| 192 DispatchDetails details = ProcessGestures(window, std::move(gestures)); | 189 DispatchDetails details = ProcessGestures(window, std::move(gestures)); |
| 193 if (details.dispatcher_destroyed) | 190 if (details.dispatcher_destroyed) |
| 194 return; | 191 return; |
| 195 } | 192 } |
| 196 | 193 |
| 197 void WindowEventDispatcher::HoldPointerMoves() { | 194 void WindowEventDispatcher::HoldPointerMoves() { |
| 198 if (!move_hold_count_) | 195 if (!move_hold_count_) |
| 199 held_event_factory_.InvalidateWeakPtrs(); | 196 held_event_factory_.InvalidateWeakPtrs(); |
| 200 ++move_hold_count_; | 197 ++move_hold_count_; |
| 201 TRACE_EVENT_ASYNC_BEGIN0("ui", "WindowEventDispatcher::HoldPointerMoves", | 198 TRACE_EVENT_ASYNC_BEGIN0("ui", "WindowEventDispatcher::HoldPointerMoves", |
| (...skipping 349 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 551 // Do not let 'held' touch events contribute to any gestures unless it is | 548 // Do not let 'held' touch events contribute to any gestures unless it is |
| 552 // being dispatched. | 549 // being dispatched. |
| 553 if (is_dispatched_held_event(event) || !held_move_event_ || | 550 if (is_dispatched_held_event(event) || !held_move_event_ || |
| 554 !held_move_event_->IsTouchEvent()) { | 551 !held_move_event_->IsTouchEvent()) { |
| 555 const ui::TouchEvent& touchevent = *event.AsTouchEvent(); | 552 const ui::TouchEvent& touchevent = *event.AsTouchEvent(); |
| 556 | 553 |
| 557 if (!touchevent.synchronous_handling_disabled()) { | 554 if (!touchevent.synchronous_handling_disabled()) { |
| 558 Window* window = static_cast<Window*>(target); | 555 Window* window = static_cast<Window*>(target); |
| 559 ui::GestureRecognizer::Gestures gestures = | 556 ui::GestureRecognizer::Gestures gestures = |
| 560 ui::GestureRecognizer::Get()->AckTouchEvent( | 557 ui::GestureRecognizer::Get()->AckTouchEvent( |
| 561 touchevent.unique_event_id(), event.result(), | 558 touchevent.unique_event_id(), event.result(), window); |
| 562 false /* is_source_touch_event_set_non_blocking */, window); | |
| 563 | 559 |
| 564 return ProcessGestures(window, std::move(gestures)); | 560 return ProcessGestures(window, std::move(gestures)); |
| 565 } | 561 } |
| 566 } | 562 } |
| 567 } | 563 } |
| 568 | 564 |
| 569 return details; | 565 return details; |
| 570 } | 566 } |
| 571 | 567 |
| 572 //////////////////////////////////////////////////////////////////////////////// | 568 //////////////////////////////////////////////////////////////////////////////// |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 941 ui::KeyEvent* event) { | 937 ui::KeyEvent* event) { |
| 942 if (skip_ime_ || !host_->has_input_method() || | 938 if (skip_ime_ || !host_->has_input_method() || |
| 943 (event->flags() & ui::EF_IS_SYNTHESIZED)) | 939 (event->flags() & ui::EF_IS_SYNTHESIZED)) |
| 944 return ui::EventDispatchDetails(); | 940 return ui::EventDispatchDetails(); |
| 945 host_->GetInputMethod()->DispatchKeyEvent(event); | 941 host_->GetInputMethod()->DispatchKeyEvent(event); |
| 946 event->StopPropagation(); | 942 event->StopPropagation(); |
| 947 return ui::EventDispatchDetails(); | 943 return ui::EventDispatchDetails(); |
| 948 } | 944 } |
| 949 | 945 |
| 950 } // namespace aura | 946 } // namespace aura |
| OLD | NEW |