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 <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 class MouseEvent; | 39 class MouseEvent; |
40 class ScrollEvent; | 40 class ScrollEvent; |
41 class TouchEvent; | 41 class TouchEvent; |
42 } | 42 } |
43 | 43 |
44 namespace aura { | 44 namespace aura { |
45 class TestScreen; | 45 class TestScreen; |
46 class WindowTargeter; | 46 class WindowTargeter; |
47 class WindowTreeHost; | 47 class WindowTreeHost; |
48 | 48 |
| 49 namespace test { |
| 50 class WindowEventDispatcherTestApi; |
| 51 } |
| 52 |
49 // WindowEventDispatcher orchestrates event dispatch within a window tree | 53 // WindowEventDispatcher orchestrates event dispatch within a window tree |
50 // owned by WindowTreeHost. WTH also owns the WED. | 54 // owned by WindowTreeHost. WTH also owns the WED. |
51 // TODO(beng): In progress, remove functionality not directly related to | 55 // TODO(beng): In progress, remove functionality not directly related to |
52 // event dispatch. | 56 // event dispatch. |
53 class AURA_EXPORT WindowEventDispatcher : public ui::EventProcessor, | 57 class AURA_EXPORT WindowEventDispatcher : public ui::EventProcessor, |
54 public ui::GestureEventHelper, | 58 public ui::GestureEventHelper, |
55 public client::CaptureDelegate, | 59 public client::CaptureDelegate, |
56 public WindowObserver, | 60 public WindowObserver, |
57 public EnvObserver { | 61 public EnvObserver { |
58 public: | 62 public: |
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // hierarchy is still intact). This didn't seem worth adding a | 115 // hierarchy is still intact). This didn't seem worth adding a |
112 // generic notification for as only this class needs to implement | 116 // generic notification for as only this class needs to implement |
113 // it. I would however like to find a way to do this via an | 117 // it. I would however like to find a way to do this via an |
114 // observer. | 118 // observer. |
115 void OnPostNotifiedWindowDestroying(Window* window); | 119 void OnPostNotifiedWindowDestroying(Window* window); |
116 | 120 |
117 private: | 121 private: |
118 FRIEND_TEST_ALL_PREFIXES(WindowEventDispatcherTest, | 122 FRIEND_TEST_ALL_PREFIXES(WindowEventDispatcherTest, |
119 KeepTranslatedEventInRoot); | 123 KeepTranslatedEventInRoot); |
120 | 124 |
| 125 friend class test::WindowEventDispatcherTestApi; |
121 friend class Window; | 126 friend class Window; |
122 friend class TestScreen; | 127 friend class TestScreen; |
123 | 128 |
124 // The parameter for OnWindowHidden() to specify why window is hidden. | 129 // The parameter for OnWindowHidden() to specify why window is hidden. |
125 enum WindowHiddenReason { | 130 enum WindowHiddenReason { |
126 WINDOW_DESTROYED, // Window is destroyed. | 131 WINDOW_DESTROYED, // Window is destroyed. |
127 WINDOW_HIDDEN, // Window is hidden. | 132 WINDOW_HIDDEN, // Window is hidden. |
128 WINDOW_MOVING, // Window is temporarily marked as hidden due to move | 133 WINDOW_MOVING, // Window is temporarily marked as hidden due to move |
129 // across root windows. | 134 // across root windows. |
130 }; | 135 }; |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 261 |
257 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. | 262 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. |
258 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; | 263 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; |
259 | 264 |
260 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); | 265 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); |
261 }; | 266 }; |
262 | 267 |
263 } // namespace aura | 268 } // namespace aura |
264 | 269 |
265 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ | 270 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ |
OLD | NEW |