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 <X11/Xlib.h> | 8 #include <X11/Xlib.h> |
9 #include <set> | 9 #include <set> |
10 #include <vector> | 10 #include <vector> |
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
235 // message until we have received a confirming XdndStatus message. | 235 // message until we have received a confirming XdndStatus message. |
236 bool waiting_on_status_; | 236 bool waiting_on_status_; |
237 | 237 |
238 // If we would send an XdndPosition message while we're waiting for an | 238 // If we would send an XdndPosition message while we're waiting for an |
239 // XdndStatus response, we need to cache the latest details we'd send. | 239 // XdndStatus response, we need to cache the latest details we'd send. |
240 scoped_ptr<std::pair<gfx::Point, unsigned long> > next_position_message_; | 240 scoped_ptr<std::pair<gfx::Point, unsigned long> > next_position_message_; |
241 | 241 |
242 // Reprocesses the most recent mouse move event if the mouse has not moved | 242 // Reprocesses the most recent mouse move event if the mouse has not moved |
243 // in a while in case the window stacking order has changed and | 243 // in a while in case the window stacking order has changed and |
244 // |source_current_window_| needs to be updated. | 244 // |source_current_window_| needs to be updated. |
245 base::OneShotTimer<DesktopDragDropClientAuraX11> repeat_mouse_move_timer_; | 245 base::OneShotTimer repeat_mouse_move_timer_; |
246 | 246 |
247 // When the mouse is released, we need to wait for the last XdndStatus message | 247 // When the mouse is released, we need to wait for the last XdndStatus message |
248 // only if we have previously received a status message from | 248 // only if we have previously received a status message from |
249 // |source_current_window_|. | 249 // |source_current_window_|. |
250 bool status_received_since_enter_; | 250 bool status_received_since_enter_; |
251 | 251 |
252 // Source side information. | 252 // Source side information. |
253 ui::OSExchangeDataProviderAuraX11 const* source_provider_; | 253 ui::OSExchangeDataProviderAuraX11 const* source_provider_; |
254 ::Window source_current_window_; | 254 ::Window source_current_window_; |
255 SourceState source_state_; | 255 SourceState source_state_; |
256 | 256 |
257 // The current drag-drop client that has an active operation. Since we have | 257 // The current drag-drop client that has an active operation. Since we have |
258 // multiple root windows and multiple DesktopDragDropClientAuraX11 instances | 258 // multiple root windows and multiple DesktopDragDropClientAuraX11 instances |
259 // it is important to maintain only one drag and drop operation at any time. | 259 // it is important to maintain only one drag and drop operation at any time. |
260 static DesktopDragDropClientAuraX11* g_current_drag_drop_client; | 260 static DesktopDragDropClientAuraX11* g_current_drag_drop_client; |
261 | 261 |
262 // The operation bitfield as requested by StartDragAndDrop. | 262 // The operation bitfield as requested by StartDragAndDrop. |
263 int drag_operation_; | 263 int drag_operation_; |
264 | 264 |
265 // We offer the other window a list of possible operations, | 265 // We offer the other window a list of possible operations, |
266 // XdndActionsList. This is the requested action from the other window. This | 266 // XdndActionsList. This is the requested action from the other window. This |
267 // is DRAG_NONE if we haven't sent out an XdndPosition message yet, haven't | 267 // is DRAG_NONE if we haven't sent out an XdndPosition message yet, haven't |
268 // yet received an XdndStatus or if the other window has told us that there's | 268 // yet received an XdndStatus or if the other window has told us that there's |
269 // no action that we can agree on. | 269 // no action that we can agree on. |
270 ui::DragDropTypes::DragOperation negotiated_operation_; | 270 ui::DragDropTypes::DragOperation negotiated_operation_; |
271 | 271 |
272 // Ends the move loop if the target is too slow to respond after the mouse is | 272 // Ends the move loop if the target is too slow to respond after the mouse is |
273 // released. | 273 // released. |
274 base::OneShotTimer<DesktopDragDropClientAuraX11> end_move_loop_timer_; | 274 base::OneShotTimer end_move_loop_timer_; |
275 | 275 |
276 // Widget that the user drags around. May be NULL. | 276 // Widget that the user drags around. May be NULL. |
277 scoped_ptr<Widget> drag_widget_; | 277 scoped_ptr<Widget> drag_widget_; |
278 | 278 |
279 // The offset of |drag_widget_| relative to the mouse position. | 279 // The offset of |drag_widget_| relative to the mouse position. |
280 gfx::Vector2d drag_widget_offset_; | 280 gfx::Vector2d drag_widget_offset_; |
281 | 281 |
282 base::WeakPtrFactory<DesktopDragDropClientAuraX11> weak_ptr_factory_; | 282 base::WeakPtrFactory<DesktopDragDropClientAuraX11> weak_ptr_factory_; |
283 | 283 |
284 DISALLOW_COPY_AND_ASSIGN(DesktopDragDropClientAuraX11); | 284 DISALLOW_COPY_AND_ASSIGN(DesktopDragDropClientAuraX11); |
285 }; | 285 }; |
286 | 286 |
287 } // namespace views | 287 } // namespace views |
288 | 288 |
289 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_AURAX11_H_ | 289 #endif // UI_VIEWS_WIDGET_DESKTOP_AURA_DESKTOP_DRAG_DROP_CLIENT_AURAX11_H_ |
OLD | NEW |