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 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 | 113 |
114 // TODO(beng): This is only needed because this cleanup needs to happen after | 114 // TODO(beng): This is only needed because this cleanup needs to happen after |
115 // all other observers are notified of OnWindowDestroying() but | 115 // all other observers are notified of OnWindowDestroying() but |
116 // before OnWindowDestroyed() is sent (i.e. while the window | 116 // before OnWindowDestroyed() is sent (i.e. while the window |
117 // hierarchy is still intact). This didn't seem worth adding a | 117 // hierarchy is still intact). This didn't seem worth adding a |
118 // generic notification for as only this class needs to implement | 118 // generic notification for as only this class needs to implement |
119 // it. I would however like to find a way to do this via an | 119 // it. I would however like to find a way to do this via an |
120 // observer. | 120 // observer. |
121 void OnPostNotifiedWindowDestroying(Window* window); | 121 void OnPostNotifiedWindowDestroying(Window* window); |
122 | 122 |
123 // True to skip sending event to the InputMethod. | |
124 void set_skip_ime(bool skip_ime) { skip_ime_ = skip_ime; } | |
125 bool should_skip_ime() const { return skip_ime_; } | |
126 | |
127 private: | 123 private: |
128 FRIEND_TEST_ALL_PREFIXES(WindowEventDispatcherTest, | 124 FRIEND_TEST_ALL_PREFIXES(WindowEventDispatcherTest, |
129 KeepTranslatedEventInRoot); | 125 KeepTranslatedEventInRoot); |
130 | 126 |
131 friend class test::WindowEventDispatcherTestApi; | 127 friend class test::WindowEventDispatcherTestApi; |
132 friend class Window; | 128 friend class Window; |
133 friend class TestScreen; | 129 friend class TestScreen; |
134 | 130 |
135 // The parameter for OnWindowHidden() to specify why window is hidden. | 131 // The parameter for OnWindowHidden() to specify why window is hidden. |
136 enum WindowHiddenReason { | 132 enum WindowHiddenReason { |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // Calls SynthesizeMouseMove() if |window| is currently visible and contains | 231 // Calls SynthesizeMouseMove() if |window| is currently visible and contains |
236 // the mouse cursor. | 232 // the mouse cursor. |
237 void SynthesizeMouseMoveAfterChangeToWindow(Window* window); | 233 void SynthesizeMouseMoveAfterChangeToWindow(Window* window); |
238 | 234 |
239 ui::EventDispatchDetails PreDispatchLocatedEvent(Window* target, | 235 ui::EventDispatchDetails PreDispatchLocatedEvent(Window* target, |
240 ui::LocatedEvent* event); | 236 ui::LocatedEvent* event); |
241 ui::EventDispatchDetails PreDispatchMouseEvent(Window* target, | 237 ui::EventDispatchDetails PreDispatchMouseEvent(Window* target, |
242 ui::MouseEvent* event); | 238 ui::MouseEvent* event); |
243 ui::EventDispatchDetails PreDispatchTouchEvent(Window* target, | 239 ui::EventDispatchDetails PreDispatchTouchEvent(Window* target, |
244 ui::TouchEvent* event); | 240 ui::TouchEvent* event); |
245 ui::EventDispatchDetails PreDispatchKeyEvent(ui::KeyEvent* event); | |
246 | 241 |
247 WindowTreeHost* host_; | 242 WindowTreeHost* host_; |
248 | 243 |
249 Window* mouse_pressed_handler_; | 244 Window* mouse_pressed_handler_; |
250 Window* mouse_moved_handler_; | 245 Window* mouse_moved_handler_; |
251 Window* event_dispatch_target_; | 246 Window* event_dispatch_target_; |
252 Window* old_dispatch_target_; | 247 Window* old_dispatch_target_; |
253 | 248 |
254 ui::FractionOfTimeWithoutUserInputRecorder | 249 ui::FractionOfTimeWithoutUserInputRecorder |
255 fraction_of_time_without_user_input_recorder_; | 250 fraction_of_time_without_user_input_recorder_; |
(...skipping 12 matching lines...) Expand all Loading... |
268 // Set when dispatching a held event. | 263 // Set when dispatching a held event. |
269 ui::LocatedEvent* dispatching_held_event_; | 264 ui::LocatedEvent* dispatching_held_event_; |
270 | 265 |
271 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; | 266 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; |
272 | 267 |
273 std::unique_ptr<MusMouseLocationUpdater> mus_mouse_location_updater_; | 268 std::unique_ptr<MusMouseLocationUpdater> mus_mouse_location_updater_; |
274 | 269 |
275 // The default EventTargeter for WindowEventDispatcher generated events. | 270 // The default EventTargeter for WindowEventDispatcher generated events. |
276 std::unique_ptr<WindowTargeter> event_targeter_; | 271 std::unique_ptr<WindowTargeter> event_targeter_; |
277 | 272 |
278 bool skip_ime_; | |
279 | |
280 // Used to schedule reposting an event. | 273 // Used to schedule reposting an event. |
281 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_; | 274 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_; |
282 | 275 |
283 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. | 276 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. |
284 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; | 277 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; |
285 | 278 |
286 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); | 279 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); |
287 }; | 280 }; |
288 | 281 |
289 } // namespace aura | 282 } // namespace aura |
290 | 283 |
291 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ | 284 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ |
OLD | NEW |