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 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" | 5 #include "ui/views/widget/desktop_aura/desktop_drag_drop_client_aurax11.h" |
6 | 6 |
7 #include <X11/Xatom.h> | 7 #include <X11/Xatom.h> |
8 | 8 |
9 #include "base/event_types.h" | 9 #include "base/event_types.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 669 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
680 // the XdndStatus and XdndFinished messages. | 680 // the XdndStatus and XdndFinished messages. |
681 StartEndMoveLoopTimer(); | 681 StartEndMoveLoopTimer(); |
682 return; | 682 return; |
683 } | 683 } |
684 | 684 |
685 move_loop_.EndMoveLoop(); | 685 move_loop_.EndMoveLoop(); |
686 return; | 686 return; |
687 } | 687 } |
688 | 688 |
689 if (negotiated_operation_ != ui::DragDropTypes::DRAG_NONE) { | 689 if (negotiated_operation_ != ui::DragDropTypes::DRAG_NONE) { |
| 690 // Start timer to end the move loop if the target takes too long to send |
| 691 // an XdndFinished message. It is important that StartEndMoveLoopTimer() |
| 692 // is called before SendXdndDrop() because SendXdndDrop() |
| 693 // sends XdndFinished synchronously if the drop target is a Chrome |
| 694 // window. |
| 695 StartEndMoveLoopTimer(); |
| 696 |
690 // We have negotiated an action with the other end. | 697 // We have negotiated an action with the other end. |
691 source_state_ = SOURCE_STATE_DROPPED; | 698 source_state_ = SOURCE_STATE_DROPPED; |
692 SendXdndDrop(source_current_window_); | 699 SendXdndDrop(source_current_window_); |
693 | |
694 // Start timer to end the move loop if the target takes too long to send | |
695 // an XdndFinished message. | |
696 StartEndMoveLoopTimer(); | |
697 return; | 700 return; |
698 } | 701 } |
699 } | 702 } |
700 | 703 |
701 move_loop_.EndMoveLoop(); | 704 move_loop_.EndMoveLoop(); |
702 } | 705 } |
703 | 706 |
704 void DesktopDragDropClientAuraX11::OnMoveLoopEnded() { | 707 void DesktopDragDropClientAuraX11::OnMoveLoopEnded() { |
705 if (source_current_window_ != None) { | 708 if (source_current_window_ != None) { |
706 SendXdndLeave(source_current_window_); | 709 SendXdndLeave(source_current_window_); |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1022 xev.xclient.window = dest_window; | 1025 xev.xclient.window = dest_window; |
1023 xev.xclient.data.l[0] = xwindow_; | 1026 xev.xclient.data.l[0] = xwindow_; |
1024 xev.xclient.data.l[1] = 0; | 1027 xev.xclient.data.l[1] = 0; |
1025 xev.xclient.data.l[2] = CurrentTime; | 1028 xev.xclient.data.l[2] = CurrentTime; |
1026 xev.xclient.data.l[3] = None; | 1029 xev.xclient.data.l[3] = None; |
1027 xev.xclient.data.l[4] = None; | 1030 xev.xclient.data.l[4] = None; |
1028 SendXClientEvent(dest_window, &xev); | 1031 SendXClientEvent(dest_window, &xev); |
1029 } | 1032 } |
1030 | 1033 |
1031 } // namespace views | 1034 } // namespace views |
OLD | NEW |