OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_AURAX11_H_ | 5 #ifndef UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_AURAX11_H_ |
6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_AURAX11_H_ | 6 #define UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_AURAX11_H_ |
7 | 7 |
8 #include <set> | 8 #include <set> |
9 #include <X11/Xlib.h> | 9 #include <X11/Xlib.h> |
10 | 10 |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
90 virtual bool IsDragDropInProgress() OVERRIDE; | 90 virtual bool IsDragDropInProgress() OVERRIDE; |
91 | 91 |
92 // Overridden from aura::WindowObserver: | 92 // Overridden from aura::WindowObserver: |
93 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; | 93 virtual void OnWindowDestroyed(aura::Window* window) OVERRIDE; |
94 | 94 |
95 // Overridden from X11WholeScreenMoveLoopDelegate: | 95 // Overridden from X11WholeScreenMoveLoopDelegate: |
96 virtual void OnMouseMovement(XMotionEvent* event) OVERRIDE; | 96 virtual void OnMouseMovement(XMotionEvent* event) OVERRIDE; |
97 virtual void OnMouseReleased() OVERRIDE; | 97 virtual void OnMouseReleased() OVERRIDE; |
98 virtual void OnMoveLoopEnded() OVERRIDE; | 98 virtual void OnMoveLoopEnded() OVERRIDE; |
99 | 99 |
100 protected: | |
101 // The following methods are virtual for the sake of testing. | |
102 | |
103 // Returns the topmost X11 window at |screen_point| and returns it if it is | |
varkha
2014/05/07 03:11:08
Nit: Do you want to rephrase it a bit (remove repe
pkotwicz
2014/05/07 15:16:36
Done.
| |
104 // Xdnd aware. Returns NULL otherwise. | |
105 virtual ::Window FindWindowFor(const gfx::Point& screen_point); | |
106 | |
107 // Sends |xev| to |xid|, optionally short circuiting the round trip to the X | |
108 // server. | |
109 virtual void SendXClientEvent(::Window xid, XEvent* xev); | |
110 | |
100 private: | 111 private: |
101 enum SourceState { | 112 enum SourceState { |
102 // |source_current_window_| will receive a drop once we receive an | 113 // |source_current_window_| will receive a drop once we receive an |
103 // XdndStatus from it. | 114 // XdndStatus from it. |
104 SOURCE_STATE_PENDING_DROP, | 115 SOURCE_STATE_PENDING_DROP, |
105 | 116 |
106 // The move looped will be ended once we receive XdndFinished from | 117 // The move looped will be ended once we receive XdndFinished from |
107 // |source_current_window_|. We should not send XdndPosition to | 118 // |source_current_window_|. We should not send XdndPosition to |
108 // |source_current_window_| while in this state. | 119 // |source_current_window_| while in this state. |
109 SOURCE_STATE_DROPPED, | 120 SOURCE_STATE_DROPPED, |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
159 void CompleteXdndPosition(::Window source_window, | 170 void CompleteXdndPosition(::Window source_window, |
160 const gfx::Point& screen_point); | 171 const gfx::Point& screen_point); |
161 | 172 |
162 void SendXdndEnter(::Window dest_window); | 173 void SendXdndEnter(::Window dest_window); |
163 void SendXdndLeave(::Window dest_window); | 174 void SendXdndLeave(::Window dest_window); |
164 void SendXdndPosition(::Window dest_window, | 175 void SendXdndPosition(::Window dest_window, |
165 const gfx::Point& screen_point, | 176 const gfx::Point& screen_point, |
166 unsigned long event_time); | 177 unsigned long event_time); |
167 void SendXdndDrop(::Window dest_window); | 178 void SendXdndDrop(::Window dest_window); |
168 | 179 |
169 // Sends |xev| to |xid|, optionally short circuiting the round trip to the X | |
170 // server. | |
171 void SendXClientEvent(::Window xid, XEvent* xev); | |
172 | |
173 // A nested message loop that notifies this object of events through the | 180 // A nested message loop that notifies this object of events through the |
174 // X11WholeScreenMoveLoopDelegate interface. | 181 // X11WholeScreenMoveLoopDelegate interface. |
175 X11WholeScreenMoveLoop move_loop_; | 182 X11WholeScreenMoveLoop move_loop_; |
176 | 183 |
177 aura::Window* root_window_; | 184 aura::Window* root_window_; |
178 | 185 |
179 Display* xdisplay_; | 186 Display* xdisplay_; |
180 ::Window xwindow_; | 187 ::Window xwindow_; |
181 | 188 |
182 ui::X11AtomCache atom_cache_; | 189 ui::X11AtomCache atom_cache_; |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
246 gfx::NativeCursor move_grab_cursor_; | 253 gfx::NativeCursor move_grab_cursor_; |
247 | 254 |
248 base::WeakPtrFactory<DesktopDragDropClientAuraX11> weak_ptr_factory_; | 255 base::WeakPtrFactory<DesktopDragDropClientAuraX11> weak_ptr_factory_; |
249 | 256 |
250 DISALLOW_COPY_AND_ASSIGN(DesktopDragDropClientAuraX11); | 257 DISALLOW_COPY_AND_ASSIGN(DesktopDragDropClientAuraX11); |
251 }; | 258 }; |
252 | 259 |
253 } // namespace views | 260 } // namespace views |
254 | 261 |
255 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_AURAX11_H_ | 262 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_AURAX11_H_ |
OLD | NEW |