| 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 <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 53 public client::CaptureDelegate, | 53 public client::CaptureDelegate, |
| 54 public WindowObserver, | 54 public WindowObserver, |
| 55 public EnvObserver { | 55 public EnvObserver { |
| 56 public: | 56 public: |
| 57 explicit WindowEventDispatcher(WindowTreeHost* host); | 57 explicit WindowEventDispatcher(WindowTreeHost* host); |
| 58 ~WindowEventDispatcher() override; | 58 ~WindowEventDispatcher() override; |
| 59 | 59 |
| 60 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } | 60 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } |
| 61 Window* mouse_moved_handler() { return mouse_moved_handler_; } | 61 Window* mouse_moved_handler() { return mouse_moved_handler_; } |
| 62 | 62 |
| 63 void set_transform_events(bool value) { transform_events_ = value; } |
| 64 |
| 63 // Repost event for re-processing. Used when exiting context menus. | 65 // Repost event for re-processing. Used when exiting context menus. |
| 64 // We support the ET_MOUSE_PRESSED, ET_TOUCH_PRESSED and ET_GESTURE_TAP_DOWN | 66 // We support the ET_MOUSE_PRESSED, ET_TOUCH_PRESSED and ET_GESTURE_TAP_DOWN |
| 65 // event types (although the latter is currently a no-op). | 67 // event types (although the latter is currently a no-op). |
| 66 void RepostEvent(const ui::LocatedEvent* event); | 68 void RepostEvent(const ui::LocatedEvent* event); |
| 67 | 69 |
| 68 // Invoked when the mouse events get enabled or disabled. | 70 // Invoked when the mouse events get enabled or disabled. |
| 69 void OnMouseEventsEnableStateChanged(bool enabled); | 71 void OnMouseEventsEnableStateChanged(bool enabled); |
| 70 | 72 |
| 71 void DispatchCancelModeEvent(); | 73 void DispatchCancelModeEvent(); |
| 72 | 74 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 235 ui::EventDispatchDetails PreDispatchTouchEvent(Window* target, | 237 ui::EventDispatchDetails PreDispatchTouchEvent(Window* target, |
| 236 ui::TouchEvent* event); | 238 ui::TouchEvent* event); |
| 237 | 239 |
| 238 WindowTreeHost* host_; | 240 WindowTreeHost* host_; |
| 239 | 241 |
| 240 Window* mouse_pressed_handler_; | 242 Window* mouse_pressed_handler_; |
| 241 Window* mouse_moved_handler_; | 243 Window* mouse_moved_handler_; |
| 242 Window* event_dispatch_target_; | 244 Window* event_dispatch_target_; |
| 243 Window* old_dispatch_target_; | 245 Window* old_dispatch_target_; |
| 244 | 246 |
| 247 bool transform_events_; |
| 248 |
| 245 bool synthesize_mouse_move_; | 249 bool synthesize_mouse_move_; |
| 246 | 250 |
| 247 // How many move holds are outstanding. We try to defer dispatching | 251 // How many move holds are outstanding. We try to defer dispatching |
| 248 // touch/mouse moves while the count is > 0. | 252 // touch/mouse moves while the count is > 0. |
| 249 int move_hold_count_; | 253 int move_hold_count_; |
| 250 // The location of |held_move_event_| is in |window_|'s coordinate. | 254 // The location of |held_move_event_| is in |window_|'s coordinate. |
| 251 std::unique_ptr<ui::LocatedEvent> held_move_event_; | 255 std::unique_ptr<ui::LocatedEvent> held_move_event_; |
| 252 | 256 |
| 253 // Allowing for reposting of events. Used when exiting context menus. | 257 // Allowing for reposting of events. Used when exiting context menus. |
| 254 std::unique_ptr<ui::LocatedEvent> held_repostable_event_; | 258 std::unique_ptr<ui::LocatedEvent> held_repostable_event_; |
| (...skipping 12 matching lines...) Expand all Loading... |
| 267 | 271 |
| 268 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. | 272 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. |
| 269 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; | 273 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; |
| 270 | 274 |
| 271 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); | 275 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); |
| 272 }; | 276 }; |
| 273 | 277 |
| 274 } // namespace aura | 278 } // namespace aura |
| 275 | 279 |
| 276 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ | 280 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ |
| OLD | NEW |