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 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
687 | 687 |
688 // It is possible for the DesktopWindowTreeHostX11 to be destroyed during the | 688 // It is possible for the DesktopWindowTreeHostX11 to be destroyed during the |
689 // move loop, which would also destroy this drag-client. So keep track of | 689 // move loop, which would also destroy this drag-client. So keep track of |
690 // whether it is alive after the drag ends. | 690 // whether it is alive after the drag ends. |
691 base::WeakPtr<DesktopDragDropClientAuraX11> alive( | 691 base::WeakPtr<DesktopDragDropClientAuraX11> alive( |
692 weak_ptr_factory_.GetWeakPtr()); | 692 weak_ptr_factory_.GetWeakPtr()); |
693 | 693 |
694 // Windows has a specific method, DoDragDrop(), which performs the entire | 694 // Windows has a specific method, DoDragDrop(), which performs the entire |
695 // drag. We have to emulate this, so we spin off a nested runloop which will | 695 // drag. We have to emulate this, so we spin off a nested runloop which will |
696 // track all cursor movement and reroute events to a specific handler. | 696 // track all cursor movement and reroute events to a specific handler. |
697 move_loop_->RunMoveLoop( | 697 move_loop_->RunMoveLoop(source_window); |
698 source_window, | 698 move_loop_->UpdateCursor( |
699 cursor_manager_->GetInitializedCursor(ui::kCursorGrabbing)); | 699 cursor_manager_->GetInitializedCursor(ui::kCursorGrabbing)); |
sadrul
2015/01/16 15:38:09
Is this going to do the right thing (i.e. would th
| |
700 | 700 |
701 if (alive) { | 701 if (alive) { |
702 drag_widget_.reset(); | 702 drag_widget_.reset(); |
703 | 703 |
704 source_provider_ = NULL; | 704 source_provider_ = NULL; |
705 g_current_drag_drop_client = NULL; | 705 g_current_drag_drop_client = NULL; |
706 drag_operation_ = 0; | 706 drag_operation_ = 0; |
707 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("XdndActionList")); | 707 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom("XdndActionList")); |
708 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom(kXdndDirectSave0)); | 708 XDeleteProperty(xdisplay_, xwindow_, atom_cache_.GetAtom(kXdndDirectSave0)); |
709 | 709 |
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1192 for (int x = 0; x < in_bitmap->width(); ++x) { | 1192 for (int x = 0; x < in_bitmap->width(); ++x) { |
1193 if (SkColorGetA(in_row[x]) > kMinAlpha) | 1193 if (SkColorGetA(in_row[x]) > kMinAlpha) |
1194 return true; | 1194 return true; |
1195 } | 1195 } |
1196 } | 1196 } |
1197 | 1197 |
1198 return false; | 1198 return false; |
1199 } | 1199 } |
1200 | 1200 |
1201 } // namespace views | 1201 } // namespace views |
OLD | NEW |