| 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 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint( | 152 DispatchDetails WindowEventDispatcher::DispatchMouseExitAtPoint( |
| 153 const gfx::Point& point) { | 153 const gfx::Point& point) { |
| 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 ui::TouchEvent orig_event(*event, window, this->window()); | |
| 163 | |
| 164 // TODO(tdresser): Move this to PreDispatchTouchEvent, to enable eager | 162 // TODO(tdresser): Move this to PreDispatchTouchEvent, to enable eager |
| 165 // gesture detection. See crbug.com/410280. | 163 // gesture detection. See crbug.com/410280. |
| 166 if (!ui::GestureRecognizer::Get() | 164 if (!ui::GestureRecognizer::Get() |
| 167 ->ProcessTouchEventPreDispatch(orig_event, window)) { | 165 ->ProcessTouchEventPreDispatch(*event, window)) { |
| 168 return; | 166 return; |
| 169 } | 167 } |
| 170 | 168 |
| 171 // 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 |
| 172 // pass an event here. | 170 // pass an event here. |
| 173 scoped_ptr<ui::GestureRecognizer::Gestures> gestures( | 171 scoped_ptr<ui::GestureRecognizer::Gestures> gestures( |
| 174 ui::GestureRecognizer::Get()->ProcessTouchEventOnAsyncAck( | 172 ui::GestureRecognizer::Get()->ProcessTouchEventOnAsyncAck( |
| 175 orig_event, result, window)); | 173 *event, result, window)); |
| 176 DispatchDetails details = ProcessGestures(gestures.get()); | 174 DispatchDetails details = ProcessGestures(gestures.get()); |
| 177 if (details.dispatcher_destroyed) | 175 if (details.dispatcher_destroyed) |
| 178 return; | 176 return; |
| 179 } | 177 } |
| 180 | 178 |
| 181 void WindowEventDispatcher::HoldPointerMoves() { | 179 void WindowEventDispatcher::HoldPointerMoves() { |
| 182 if (!move_hold_count_) | 180 if (!move_hold_count_) |
| 183 held_event_factory_.InvalidateWeakPtrs(); | 181 held_event_factory_.InvalidateWeakPtrs(); |
| 184 ++move_hold_count_; | 182 ++move_hold_count_; |
| 185 TRACE_EVENT_ASYNC_BEGIN0("ui", "WindowEventDispatcher::HoldPointerMoves", | 183 TRACE_EVENT_ASYNC_BEGIN0("ui", "WindowEventDispatcher::HoldPointerMoves", |
| (...skipping 717 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 903 | 901 |
| 904 default: | 902 default: |
| 905 NOTREACHED(); | 903 NOTREACHED(); |
| 906 break; | 904 break; |
| 907 } | 905 } |
| 908 | 906 |
| 909 PreDispatchLocatedEvent(target, event); | 907 PreDispatchLocatedEvent(target, event); |
| 910 } | 908 } |
| 911 | 909 |
| 912 } // namespace aura | 910 } // namespace aura |
| OLD | NEW |