| 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 #ifndef UI_AURA_WINDOW_EVENT_DISPATCHER_H_ | 5 #ifndef UI_AURA_WINDOW_EVENT_DISPATCHER_H_ |
| 6 #define UI_AURA_WINDOW_EVENT_DISPATCHER_H_ | 6 #define UI_AURA_WINDOW_EVENT_DISPATCHER_H_ |
| 7 | 7 |
| 8 #include <stdint.h> | |
| 9 | |
| 10 #include <memory> | 8 #include <memory> |
| 11 #include <vector> | 9 #include <vector> |
| 12 | 10 |
| 13 #include "base/gtest_prod_util.h" | 11 #include "base/gtest_prod_util.h" |
| 14 #include "base/macros.h" | 12 #include "base/macros.h" |
| 15 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
| 16 #include "base/memory/weak_ptr.h" | 14 #include "base/memory/weak_ptr.h" |
| 17 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
| 18 #include "base/scoped_observer.h" | 16 #include "base/scoped_observer.h" |
| 19 #include "ui/aura/aura_export.h" | 17 #include "ui/aura/aura_export.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 38 class GestureEvent; | 36 class GestureEvent; |
| 39 class GestureRecognizer; | 37 class GestureRecognizer; |
| 40 class KeyEvent; | 38 class KeyEvent; |
| 41 class MouseEvent; | 39 class MouseEvent; |
| 42 class ScrollEvent; | 40 class ScrollEvent; |
| 43 class TouchEvent; | 41 class TouchEvent; |
| 44 } | 42 } |
| 45 | 43 |
| 46 namespace aura { | 44 namespace aura { |
| 47 class TestScreen; | 45 class TestScreen; |
| 46 class EnvInputStateController; |
| 48 class WindowTargeter; | 47 class WindowTargeter; |
| 49 class WindowTreeHost; | 48 class WindowTreeHost; |
| 50 | 49 |
| 51 namespace test { | 50 namespace test { |
| 52 class WindowEventDispatcherTestApi; | 51 class WindowEventDispatcherTestApi; |
| 53 } | 52 } |
| 54 | 53 |
| 55 // WindowEventDispatcher orchestrates event dispatch within a window tree | 54 // WindowEventDispatcher orchestrates event dispatch within a window tree |
| 56 // owned by WindowTreeHost. WTH also owns the WED. | 55 // owned by WindowTreeHost. WTH also owns the WED. |
| 57 // TODO(beng): In progress, remove functionality not directly related to | 56 // TODO(beng): In progress, remove functionality not directly related to |
| (...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 | 238 |
| 240 ui::EventDispatchDetails PreDispatchLocatedEvent(Window* target, | 239 ui::EventDispatchDetails PreDispatchLocatedEvent(Window* target, |
| 241 ui::LocatedEvent* event); | 240 ui::LocatedEvent* event); |
| 242 ui::EventDispatchDetails PreDispatchMouseEvent(Window* target, | 241 ui::EventDispatchDetails PreDispatchMouseEvent(Window* target, |
| 243 ui::MouseEvent* event); | 242 ui::MouseEvent* event); |
| 244 ui::EventDispatchDetails PreDispatchTouchEvent(Window* target, | 243 ui::EventDispatchDetails PreDispatchTouchEvent(Window* target, |
| 245 ui::TouchEvent* event); | 244 ui::TouchEvent* event); |
| 246 | 245 |
| 247 WindowTreeHost* host_; | 246 WindowTreeHost* host_; |
| 248 | 247 |
| 249 // Touch ids that are currently down. | |
| 250 uint32_t touch_ids_down_; | |
| 251 | |
| 252 Window* mouse_pressed_handler_; | 248 Window* mouse_pressed_handler_; |
| 253 Window* mouse_moved_handler_; | 249 Window* mouse_moved_handler_; |
| 254 Window* event_dispatch_target_; | 250 Window* event_dispatch_target_; |
| 255 Window* old_dispatch_target_; | 251 Window* old_dispatch_target_; |
| 256 | 252 |
| 257 bool synthesize_mouse_move_; | 253 bool synthesize_mouse_move_; |
| 258 | 254 |
| 259 // How many move holds are outstanding. We try to defer dispatching | 255 // How many move holds are outstanding. We try to defer dispatching |
| 260 // touch/mouse moves while the count is > 0. | 256 // touch/mouse moves while the count is > 0. |
| 261 int move_hold_count_; | 257 int move_hold_count_; |
| 262 // The location of |held_move_event_| is in |window_|'s coordinate. | 258 // The location of |held_move_event_| is in |window_|'s coordinate. |
| 263 std::unique_ptr<ui::LocatedEvent> held_move_event_; | 259 std::unique_ptr<ui::LocatedEvent> held_move_event_; |
| 264 | 260 |
| 265 // Allowing for reposting of events. Used when exiting context menus. | 261 // Allowing for reposting of events. Used when exiting context menus. |
| 266 std::unique_ptr<ui::LocatedEvent> held_repostable_event_; | 262 std::unique_ptr<ui::LocatedEvent> held_repostable_event_; |
| 267 | 263 |
| 268 // Set when dispatching a held event. | 264 // Set when dispatching a held event. |
| 269 ui::LocatedEvent* dispatching_held_event_; | 265 ui::LocatedEvent* dispatching_held_event_; |
| 270 | 266 |
| 271 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; | 267 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; |
| 272 | 268 |
| 273 bool transform_events_; | 269 bool transform_events_; |
| 274 | 270 |
| 271 std::unique_ptr<EnvInputStateController> env_controller_; |
| 272 |
| 275 // Used to schedule reposting an event. | 273 // Used to schedule reposting an event. |
| 276 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_; | 274 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_; |
| 277 | 275 |
| 278 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. | 276 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. |
| 279 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; | 277 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; |
| 280 | 278 |
| 281 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); | 279 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); |
| 282 }; | 280 }; |
| 283 | 281 |
| 284 } // namespace aura | 282 } // namespace aura |
| 285 | 283 |
| 286 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ | 284 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ |
| OLD | NEW |