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 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 // Repost event for re-processing. Used when exiting context menus. | 65 // Repost event for re-processing. Used when exiting context menus. |
66 // We only support the ET_MOUSE_PRESSED and ET_GESTURE_TAP_DOWN event | 66 // We only support the ET_MOUSE_PRESSED and ET_GESTURE_TAP_DOWN event |
67 // types (although the latter is currently a no-op). | 67 // types (although the latter is currently a no-op). |
68 void RepostEvent(const ui::LocatedEvent& event); | 68 void RepostEvent(const ui::LocatedEvent& event); |
69 | 69 |
70 // Invoked when the mouse events get enabled or disabled. | 70 // Invoked when the mouse events get enabled or disabled. |
71 void OnMouseEventsEnableStateChanged(bool enabled); | 71 void OnMouseEventsEnableStateChanged(bool enabled); |
72 | 72 |
73 void DispatchCancelModeEvent(); | 73 void DispatchCancelModeEvent(); |
74 | 74 |
75 // Handles a gesture event. Returns true if handled. Unlike the other | |
76 // event-dispatching function (e.g. for touch/mouse/keyboard events), gesture | |
77 // events are dispatched from GestureRecognizer instead of WindowTreeHost. | |
78 void DispatchGestureEvent(ui::GestureEvent* event); | |
79 | |
80 // Dispatches a ui::ET_MOUSE_EXITED event at |point|. | 75 // Dispatches a ui::ET_MOUSE_EXITED event at |point|. |
81 // TODO(beng): needed only for WTH::OnCursorVisibilityChanged(). | 76 // TODO(beng): needed only for WTH::OnCursorVisibilityChanged(). |
82 void DispatchMouseExitAtPoint(const gfx::Point& point); | 77 void DispatchMouseExitAtPoint(const gfx::Point& point); |
83 | 78 |
84 // Gesture Recognition ------------------------------------------------------- | 79 // Gesture Recognition ------------------------------------------------------- |
85 | 80 |
86 // When a touch event is dispatched to a Window, it may want to process the | 81 // When a touch event is dispatched to a Window, it may want to process the |
87 // touch event asynchronously. In such cases, the window should consume the | 82 // touch event asynchronously. In such cases, the window should consume the |
88 // event during the event dispatch. Once the event is properly processed, the | 83 // event during the event dispatch. Once the event is properly processed, the |
89 // window should let the WindowEventDispatcher know about the result of the | 84 // window should let the WindowEventDispatcher know about the result of the |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 | 172 |
178 // Overridden from ui::EventDispatcherDelegate. | 173 // Overridden from ui::EventDispatcherDelegate. |
179 virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE; | 174 virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE; |
180 virtual ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target, | 175 virtual ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target, |
181 ui::Event* event) OVERRIDE; | 176 ui::Event* event) OVERRIDE; |
182 virtual ui::EventDispatchDetails PostDispatchEvent( | 177 virtual ui::EventDispatchDetails PostDispatchEvent( |
183 ui::EventTarget* target, const ui::Event& event) OVERRIDE; | 178 ui::EventTarget* target, const ui::Event& event) OVERRIDE; |
184 | 179 |
185 // Overridden from ui::GestureEventHelper. | 180 // Overridden from ui::GestureEventHelper. |
186 virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) OVERRIDE; | 181 virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) OVERRIDE; |
187 virtual void DispatchPostponedGestureEvent(ui::GestureEvent* event) OVERRIDE; | 182 virtual void DispatchGestureEvent(ui::GestureEvent* event) OVERRIDE; |
188 virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE; | 183 virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE; |
189 | 184 |
190 // Overridden from WindowObserver: | 185 // Overridden from WindowObserver: |
191 virtual void OnWindowDestroying(Window* window) OVERRIDE; | 186 virtual void OnWindowDestroying(Window* window) OVERRIDE; |
192 virtual void OnWindowDestroyed(Window* window) OVERRIDE; | 187 virtual void OnWindowDestroyed(Window* window) OVERRIDE; |
193 virtual void OnWindowAddedToRootWindow(Window* window) OVERRIDE; | 188 virtual void OnWindowAddedToRootWindow(Window* window) OVERRIDE; |
194 virtual void OnWindowRemovingFromRootWindow(Window* window, | 189 virtual void OnWindowRemovingFromRootWindow(Window* window, |
195 Window* new_root) OVERRIDE; | 190 Window* new_root) OVERRIDE; |
196 virtual void OnWindowVisibilityChanging(Window* window, | 191 virtual void OnWindowVisibilityChanging(Window* window, |
197 bool visible) OVERRIDE; | 192 bool visible) OVERRIDE; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
261 | 256 |
262 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. | 257 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. |
263 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; | 258 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; |
264 | 259 |
265 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); | 260 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); |
266 }; | 261 }; |
267 | 262 |
268 } // namespace aura | 263 } // namespace aura |
269 | 264 |
270 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ | 265 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ |
OLD | NEW |