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 |
75 // Dispatches a ui::ET_MOUSE_EXITED event at |point|. | 80 // Dispatches a ui::ET_MOUSE_EXITED event at |point|. |
76 // TODO(beng): needed only for WTH::OnCursorVisibilityChanged(). | 81 // TODO(beng): needed only for WTH::OnCursorVisibilityChanged(). |
77 void DispatchMouseExitAtPoint(const gfx::Point& point); | 82 void DispatchMouseExitAtPoint(const gfx::Point& point); |
78 | 83 |
79 // Gesture Recognition ------------------------------------------------------- | 84 // Gesture Recognition ------------------------------------------------------- |
80 | 85 |
81 // When a touch event is dispatched to a Window, it may want to process the | 86 // When a touch event is dispatched to a Window, it may want to process the |
82 // touch event asynchronously. In such cases, the window should consume the | 87 // touch event asynchronously. In such cases, the window should consume the |
83 // event during the event dispatch. Once the event is properly processed, the | 88 // event during the event dispatch. Once the event is properly processed, the |
84 // window should let the WindowEventDispatcher know about the result of the | 89 // window should let the WindowEventDispatcher know about the result of the |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
172 | 177 |
173 // Overridden from ui::EventDispatcherDelegate. | 178 // Overridden from ui::EventDispatcherDelegate. |
174 virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE; | 179 virtual bool CanDispatchToTarget(ui::EventTarget* target) OVERRIDE; |
175 virtual ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target, | 180 virtual ui::EventDispatchDetails PreDispatchEvent(ui::EventTarget* target, |
176 ui::Event* event) OVERRIDE; | 181 ui::Event* event) OVERRIDE; |
177 virtual ui::EventDispatchDetails PostDispatchEvent( | 182 virtual ui::EventDispatchDetails PostDispatchEvent( |
178 ui::EventTarget* target, const ui::Event& event) OVERRIDE; | 183 ui::EventTarget* target, const ui::Event& event) OVERRIDE; |
179 | 184 |
180 // Overridden from ui::GestureEventHelper. | 185 // Overridden from ui::GestureEventHelper. |
181 virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) OVERRIDE; | 186 virtual bool CanDispatchToConsumer(ui::GestureConsumer* consumer) OVERRIDE; |
182 virtual void DispatchGestureEvent(ui::GestureEvent* event) OVERRIDE; | 187 virtual void DispatchPostponedGestureEvent(ui::GestureEvent* event) OVERRIDE; |
183 virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE; | 188 virtual void DispatchCancelTouchEvent(ui::TouchEvent* event) OVERRIDE; |
184 | 189 |
185 // Overridden from WindowObserver: | 190 // Overridden from WindowObserver: |
186 virtual void OnWindowDestroying(Window* window) OVERRIDE; | 191 virtual void OnWindowDestroying(Window* window) OVERRIDE; |
187 virtual void OnWindowDestroyed(Window* window) OVERRIDE; | 192 virtual void OnWindowDestroyed(Window* window) OVERRIDE; |
188 virtual void OnWindowAddedToRootWindow(Window* window) OVERRIDE; | 193 virtual void OnWindowAddedToRootWindow(Window* window) OVERRIDE; |
189 virtual void OnWindowRemovingFromRootWindow(Window* window, | 194 virtual void OnWindowRemovingFromRootWindow(Window* window, |
190 Window* new_root) OVERRIDE; | 195 Window* new_root) OVERRIDE; |
191 virtual void OnWindowVisibilityChanging(Window* window, | 196 virtual void OnWindowVisibilityChanging(Window* window, |
192 bool visible) OVERRIDE; | 197 bool visible) OVERRIDE; |
(...skipping 63 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 |