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 <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/gtest_prod_util.h" | 13 #include "base/gtest_prod_util.h" |
13 #include "base/macros.h" | 14 #include "base/macros.h" |
14 #include "base/memory/ref_counted.h" | 15 #include "base/memory/ref_counted.h" |
15 #include "base/memory/scoped_ptr.h" | |
16 #include "base/memory/weak_ptr.h" | 16 #include "base/memory/weak_ptr.h" |
17 #include "base/message_loop/message_loop.h" | 17 #include "base/message_loop/message_loop.h" |
18 #include "base/scoped_observer.h" | 18 #include "base/scoped_observer.h" |
19 #include "ui/aura/aura_export.h" | 19 #include "ui/aura/aura_export.h" |
20 #include "ui/aura/client/capture_delegate.h" | 20 #include "ui/aura/client/capture_delegate.h" |
21 #include "ui/aura/env_observer.h" | 21 #include "ui/aura/env_observer.h" |
22 #include "ui/aura/window_observer.h" | 22 #include "ui/aura/window_observer.h" |
23 #include "ui/base/cursor/cursor.h" | 23 #include "ui/base/cursor/cursor.h" |
24 #include "ui/events/event_constants.h" | 24 #include "ui/events/event_constants.h" |
25 #include "ui/events/event_processor.h" | 25 #include "ui/events/event_processor.h" |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 Window* mouse_moved_handler_; | 254 Window* mouse_moved_handler_; |
255 Window* event_dispatch_target_; | 255 Window* event_dispatch_target_; |
256 Window* old_dispatch_target_; | 256 Window* old_dispatch_target_; |
257 | 257 |
258 bool synthesize_mouse_move_; | 258 bool synthesize_mouse_move_; |
259 | 259 |
260 // How many move holds are outstanding. We try to defer dispatching | 260 // How many move holds are outstanding. We try to defer dispatching |
261 // touch/mouse moves while the count is > 0. | 261 // touch/mouse moves while the count is > 0. |
262 int move_hold_count_; | 262 int move_hold_count_; |
263 // The location of |held_move_event_| is in |window_|'s coordinate. | 263 // The location of |held_move_event_| is in |window_|'s coordinate. |
264 scoped_ptr<ui::LocatedEvent> held_move_event_; | 264 std::unique_ptr<ui::LocatedEvent> held_move_event_; |
265 | 265 |
266 // Allowing for reposting of events. Used when exiting context menus. | 266 // Allowing for reposting of events. Used when exiting context menus. |
267 scoped_ptr<ui::LocatedEvent> held_repostable_event_; | 267 std::unique_ptr<ui::LocatedEvent> held_repostable_event_; |
268 | 268 |
269 // Set when dispatching a held event. | 269 // Set when dispatching a held event. |
270 ui::LocatedEvent* dispatching_held_event_; | 270 ui::LocatedEvent* dispatching_held_event_; |
271 | 271 |
272 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; | 272 ScopedObserver<aura::Window, aura::WindowObserver> observer_manager_; |
273 | 273 |
274 bool transform_events_; | 274 bool transform_events_; |
275 | 275 |
276 // Used to schedule reposting an event. | 276 // Used to schedule reposting an event. |
277 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_; | 277 base::WeakPtrFactory<WindowEventDispatcher> repost_event_factory_; |
278 | 278 |
279 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. | 279 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. |
280 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; | 280 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; |
281 | 281 |
282 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); | 282 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); |
283 }; | 283 }; |
284 | 284 |
285 } // namespace aura | 285 } // namespace aura |
286 | 286 |
287 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ | 287 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ |
OLD | NEW |