| 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 "ash/drag_drop/drag_drop_controller.h" | 5 #include "ash/drag_drop/drag_drop_controller.h" |
| 6 | 6 |
| 7 #include "ash/drag_drop/drag_image_view.h" | 7 #include "ash/drag_drop/drag_image_view.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "base/message_loop.h" | 9 #include "base/message_loop.h" |
| 10 #include "ui/aura/client/drag_drop_delegate.h" | 10 #include "ui/aura/client/drag_drop_delegate.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 delegate->OnDragEntered(e); | 107 delegate->OnDragEntered(e); |
| 108 } | 108 } |
| 109 } else { | 109 } else { |
| 110 if ((delegate = aura::client::GetDragDropDelegate(drag_window_))) { | 110 if ((delegate = aura::client::GetDragDropDelegate(drag_window_))) { |
| 111 aura::DropTargetEvent e(*drag_data_, | 111 aura::DropTargetEvent e(*drag_data_, |
| 112 event.location(), | 112 event.location(), |
| 113 event.root_location(), | 113 event.root_location(), |
| 114 drag_operation_); | 114 drag_operation_); |
| 115 int op = delegate->OnDragUpdated(e); | 115 int op = delegate->OnDragUpdated(e); |
| 116 gfx::NativeCursor cursor = (op == ui::DragDropTypes::DRAG_NONE)? | 116 gfx::NativeCursor cursor = (op == ui::DragDropTypes::DRAG_NONE)? |
| 117 ui::kCursorNoDrop : ui::kCursorCopy; | 117 ui::kCursorMove : ui::kCursorHand; |
| 118 Shell::GetRootWindow()->SetCursor(cursor); | 118 Shell::GetRootWindow()->SetCursor(cursor); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 DCHECK(drag_image_.get()); | 122 DCHECK(drag_image_.get()); |
| 123 if (drag_image_->visible()) { | 123 if (drag_image_->visible()) { |
| 124 drag_image_->SetScreenPosition( | 124 drag_image_->SetScreenPosition( |
| 125 event.root_location().Subtract(drag_image_offset_)); | 125 event.root_location().Subtract(drag_image_offset_)); |
| 126 } | 126 } |
| 127 } | 127 } |
| (...skipping 136 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 264 void DragDropController::Cleanup() { | 264 void DragDropController::Cleanup() { |
| 265 if (drag_window_) | 265 if (drag_window_) |
| 266 drag_window_->RemoveObserver(this); | 266 drag_window_->RemoveObserver(this); |
| 267 drag_window_ = NULL; | 267 drag_window_ = NULL; |
| 268 drag_data_ = NULL; | 268 drag_data_ = NULL; |
| 269 drag_drop_in_progress_ = false; | 269 drag_drop_in_progress_ = false; |
| 270 } | 270 } |
| 271 | 271 |
| 272 } // namespace internal | 272 } // namespace internal |
| 273 } // namespace ash | 273 } // namespace ash |
| OLD | NEW |