| 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> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 // event dispatch. | 58 // event dispatch. |
| 59 class AURA_EXPORT WindowEventDispatcher : public ui::EventProcessor, | 59 class AURA_EXPORT WindowEventDispatcher : public ui::EventProcessor, |
| 60 public ui::GestureEventHelper, | 60 public ui::GestureEventHelper, |
| 61 public client::CaptureDelegate, | 61 public client::CaptureDelegate, |
| 62 public WindowObserver, | 62 public WindowObserver, |
| 63 public EnvObserver { | 63 public EnvObserver { |
| 64 public: | 64 public: |
| 65 explicit WindowEventDispatcher(WindowTreeHost* host); | 65 explicit WindowEventDispatcher(WindowTreeHost* host); |
| 66 ~WindowEventDispatcher() override; | 66 ~WindowEventDispatcher() override; |
| 67 | 67 |
| 68 void set_transform_events(bool value) { transform_events_ = value; } | |
| 69 | |
| 70 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } | 68 Window* mouse_pressed_handler() { return mouse_pressed_handler_; } |
| 71 Window* mouse_moved_handler() { return mouse_moved_handler_; } | 69 Window* mouse_moved_handler() { return mouse_moved_handler_; } |
| 72 | 70 |
| 73 // Repost event for re-processing. Used when exiting context menus. | 71 // Repost event for re-processing. Used when exiting context menus. |
| 74 // We support the ET_MOUSE_PRESSED, ET_TOUCH_PRESSED and ET_GESTURE_TAP_DOWN | 72 // We support the ET_MOUSE_PRESSED, ET_TOUCH_PRESSED and ET_GESTURE_TAP_DOWN |
| 75 // event types (although the latter is currently a no-op). | 73 // event types (although the latter is currently a no-op). |
| 76 void RepostEvent(const ui::LocatedEvent* event); | 74 void RepostEvent(const ui::LocatedEvent* event); |
| 77 | 75 |
| 78 // Invoked when the mouse events get enabled or disabled. | 76 // Invoked when the mouse events get enabled or disabled. |
| 79 void OnMouseEventsEnableStateChanged(bool enabled); | 77 void OnMouseEventsEnableStateChanged(bool enabled); |
| (...skipping 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 std::unique_ptr<ui::LocatedEvent> held_move_event_; | 262 std::unique_ptr<ui::LocatedEvent> held_move_event_; |
| 265 | 263 |
| 266 // Allowing for reposting of events. Used when exiting context menus. | 264 // Allowing for reposting of events. Used when exiting context menus. |
| 267 std::unique_ptr<ui::LocatedEvent> held_repostable_event_; | 265 std::unique_ptr<ui::LocatedEvent> held_repostable_event_; |
| 268 | 266 |
| 269 // Set when dispatching a held event. | 267 // Set when dispatching a held event. |
| 270 ui::LocatedEvent* dispatching_held_event_; | 268 ui::LocatedEvent* dispatching_held_event_; |
| 271 | 269 |
| 272 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; | 270 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; |
| 273 | 271 |
| 274 bool transform_events_; | |
| 275 | |
| 276 // Used to schedule reposting an event. | 272 // Used to schedule reposting an event. |
| 277 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_; | 273 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_; |
| 278 | 274 |
| 279 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. | 275 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. |
| 280 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; | 276 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; |
| 281 | 277 |
| 282 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); | 278 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); |
| 283 }; | 279 }; |
| 284 | 280 |
| 285 } // namespace aura | 281 } // namespace aura |
| 286 | 282 |
| 287 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ | 283 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ |
| OLD | NEW |