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 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
69 // Repost event for re-processing. Used when exiting context menus. | 69 // Repost event for re-processing. Used when exiting context menus. |
70 // We only support the ET_MOUSE_PRESSED and ET_GESTURE_TAP_DOWN event | 70 // We only support the ET_MOUSE_PRESSED and ET_GESTURE_TAP_DOWN event |
71 // types (although the latter is currently a no-op). | 71 // types (although the latter is currently a no-op). |
72 void RepostEvent(const ui::LocatedEvent& event); | 72 void RepostEvent(const ui::LocatedEvent& event); |
73 | 73 |
74 // Invoked when the mouse events get enabled or disabled. | 74 // Invoked when the mouse events get enabled or disabled. |
75 void OnMouseEventsEnableStateChanged(bool enabled); | 75 void OnMouseEventsEnableStateChanged(bool enabled); |
76 | 76 |
77 void DispatchCancelModeEvent(); | 77 void DispatchCancelModeEvent(); |
78 | 78 |
79 // Dispatches a ui::ET_MOUSE_EXITED event at |point|. | 79 // Dispatches a ui::ET_MOUSE_EXITED event at |point| to the |target| |
| 80 // If the |target| is NULL, we will dispatch the event to the root-window |
80 // TODO(beng): needed only for WTH::OnCursorVisibilityChanged(). | 81 // TODO(beng): needed only for WTH::OnCursorVisibilityChanged(). |
81 ui::EventDispatchDetails DispatchMouseExitAtPoint( | 82 ui::EventDispatchDetails DispatchMouseExitAtPoint(Window* target, |
82 const gfx::Point& point) WARN_UNUSED_RESULT; | 83 const gfx::Point& point) |
| 84 WARN_UNUSED_RESULT; |
83 | 85 |
84 // Gesture Recognition ------------------------------------------------------- | 86 // Gesture Recognition ------------------------------------------------------- |
85 | 87 |
86 // When a touch event is dispatched to a Window, it may want to process the | 88 // 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 | 89 // touch event asynchronously. In such cases, the window should consume the |
88 // event during the event dispatch. Once the event is properly processed, the | 90 // event during the event dispatch. Once the event is properly processed, the |
89 // window should let the WindowEventDispatcher know about the result of the | 91 // window should let the WindowEventDispatcher know about the result of the |
90 // event processing, so that gesture events can be properly created and | 92 // event processing, so that gesture events can be properly created and |
91 // dispatched. |event|'s location should be in the dispatcher's coordinate | 93 // dispatched. |event|'s location should be in the dispatcher's coordinate |
92 // space, in DIPs. | 94 // space, in DIPs. |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
144 // coordinate. But the event processing from WindowEventDispatcher onwards | 146 // coordinate. But the event processing from WindowEventDispatcher onwards |
145 // happen in device-independent pixel coordinate. So it is necessary to update | 147 // happen in device-independent pixel coordinate. So it is necessary to update |
146 // the event received from the host. | 148 // the event received from the host. |
147 void TransformEventForDeviceScaleFactor(ui::LocatedEvent* event); | 149 void TransformEventForDeviceScaleFactor(ui::LocatedEvent* event); |
148 | 150 |
149 // Dispatches OnMouseExited to the |window| which is hiding if necessary. | 151 // Dispatches OnMouseExited to the |window| which is hiding if necessary. |
150 void DispatchMouseExitToHidingWindow(Window* window); | 152 void DispatchMouseExitToHidingWindow(Window* window); |
151 | 153 |
152 // Dispatches the specified event type (intended for enter/exit) to the | 154 // Dispatches the specified event type (intended for enter/exit) to the |
153 // |mouse_moved_handler_|. | 155 // |mouse_moved_handler_|. |
154 ui::EventDispatchDetails DispatchMouseEnterOrExit( | 156 // The event's location will be converted from |target|coordinate system to |
155 const ui::MouseEvent& event, | 157 // |mouse_moved_handler_| coordinate system. |
156 ui::EventType type) WARN_UNUSED_RESULT; | 158 ui::EventDispatchDetails DispatchMouseEnterOrExit(Window* target, |
| 159 const ui::MouseEvent& event, |
| 160 ui::EventType type) |
| 161 WARN_UNUSED_RESULT; |
157 ui::EventDispatchDetails ProcessGestures( | 162 ui::EventDispatchDetails ProcessGestures( |
158 ui::GestureRecognizer::Gestures* gestures) WARN_UNUSED_RESULT; | 163 ui::GestureRecognizer::Gestures* gestures) WARN_UNUSED_RESULT; |
159 | 164 |
160 // Called when a window becomes invisible, either by being removed | 165 // Called when a window becomes invisible, either by being removed |
161 // from root window hierarchy, via SetVisible(false) or being destroyed. | 166 // from root window hierarchy, via SetVisible(false) or being destroyed. |
162 // |reason| specifies what triggered the hiding. Note that becoming invisible | 167 // |reason| specifies what triggered the hiding. Note that becoming invisible |
163 // will cause a window to lose capture and some windows may destroy themselves | 168 // will cause a window to lose capture and some windows may destroy themselves |
164 // on capture (like DragDropTracker). | 169 // on capture (like DragDropTracker). |
165 void OnWindowHidden(Window* invisible, WindowHiddenReason reason); | 170 void OnWindowHidden(Window* invisible, WindowHiddenReason reason); |
166 | 171 |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 | 267 |
263 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. | 268 // Used to schedule DispatchHeldEvents() when |move_hold_count_| goes to 0. |
264 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; | 269 base::WeakPtrFactory<WindowEventDispatcher> held_event_factory_; |
265 | 270 |
266 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); | 271 DISALLOW_COPY_AND_ASSIGN(WindowEventDispatcher); |
267 }; | 272 }; |
268 | 273 |
269 } // namespace aura | 274 } // namespace aura |
270 | 275 |
271 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ | 276 #endif // UI_AURA_WINDOW_EVENT_DISPATCHER_H_ |
OLD | NEW |