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