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 // Overridden from ui::EventProcessor: |
| 64 ui::EventTargeter* GetDefaultEventTargeter() override; |
| 65 |
63 // Repost event for re-processing. Used when exiting context menus. | 66 // 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 | 67 // 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). | 68 // event types (although the latter is currently a no-op). |
66 void RepostEvent(const ui::LocatedEvent* event); | 69 void RepostEvent(const ui::LocatedEvent* event); |
67 | 70 |
68 // Invoked when the mouse events get enabled or disabled. | 71 // Invoked when the mouse events get enabled or disabled. |
69 void OnMouseEventsEnableStateChanged(bool enabled); | 72 void OnMouseEventsEnableStateChanged(bool enabled); |
70 | 73 |
71 void DispatchCancelModeEvent(); | 74 void DispatchCancelModeEvent(); |
72 | 75 |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
166 | 169 |
167 bool is_dispatched_held_event(const ui::Event& event) const; | 170 bool is_dispatched_held_event(const ui::Event& event) const; |
168 | 171 |
169 // Overridden from aura::client::CaptureDelegate: | 172 // Overridden from aura::client::CaptureDelegate: |
170 void UpdateCapture(Window* old_capture, Window* new_capture) override; | 173 void UpdateCapture(Window* old_capture, Window* new_capture) override; |
171 void OnOtherRootGotCapture() override; | 174 void OnOtherRootGotCapture() override; |
172 void SetNativeCapture() override; | 175 void SetNativeCapture() override; |
173 void ReleaseNativeCapture() override; | 176 void ReleaseNativeCapture() override; |
174 | 177 |
175 // Overridden from ui::EventProcessor: | 178 // Overridden from ui::EventProcessor: |
176 ui::EventTarget* GetRootTarget() override; | 179 ui::EventTarget* GetRootForEvent(ui::Event* event) override; |
177 void OnEventProcessingStarted(ui::Event* event) override; | 180 void OnEventProcessingStarted(ui::Event* event) override; |
178 void OnEventProcessingFinished(ui::Event* event) override; | 181 void OnEventProcessingFinished(ui::Event* event) override; |
179 | 182 |
180 // Overridden from ui::EventDispatcherDelegate. | 183 // Overridden from ui::EventDispatcherDelegate. |
181 bool CanDispatchToTarget(ui::EventTarget* target) override; | 184 bool CanDispatchToTarget(ui::EventTarget* target) override; |
182 ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target, | 185 ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target, |
183 ui::Event* event) override; | 186 ui::Event* event) override; |
184 ui::EventDispatchDetails PostDispatchEvent(ui::EventTarget* target, | 187 ui::EventDispatchDetails PostDispatchEvent(ui::EventTarget* target, |
185 const ui::Event& event) override; | 188 const ui::Event& event) override; |
186 | 189 |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
255 | 258 |
256 // Set when dispatching a held event. | 259 // Set when dispatching a held event. |
257 ui::LocatedEvent* dispatching_held_event_; | 260 ui::LocatedEvent* dispatching_held_event_; |
258 | 261 |
259 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; | 262 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; |
260 | 263 |
261 std::unique_ptr<EnvInputStateController> env_controller_; | 264 std::unique_ptr<EnvInputStateController> env_controller_; |
262 | 265 |
263 std::unique_ptr<MusMouseLocationUpdater> mus_mouse_location_updater_; | 266 std::unique_ptr<MusMouseLocationUpdater> mus_mouse_location_updater_; |
264 | 267 |
| 268 // The default EventTargeter for WindowEventDispatcher generated events. |
| 269 std::unique_ptr<ui::EventTargeter> event_targeter_; |
| 270 |
265 // Used to schedule reposting an event. | 271 // Used to schedule reposting an event. |
266 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_; | 272 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_; |
267 | 273 |
268 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. | 274 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. |
269 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; | 275 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; |
270 | 276 |
271 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); | 277 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); |
272 }; | 278 }; |
273 | 279 |
274 } // namespace aura | 280 } // namespace aura |
275 | 281 |
276 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ | 282 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ |
OLD | NEW |