diff options
author | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-01 08:36:44 +0000 |
---|---|---|
committer | varunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-06-01 08:36:44 +0000 |
commit | 75001aab2af6da7c04d30daf3019f0dba4982432 (patch) | |
tree | 65993c188c917e059f1ff740852e28e83633844c /ash/drag_drop/drag_drop_controller.cc | |
parent | 9a6ac2ba01c70174bf366ab75727cef0cdb8c26c (diff) | |
download | chromium_src-75001aab2af6da7c04d30daf3019f0dba4982432.zip chromium_src-75001aab2af6da7c04d30daf3019f0dba4982432.tar.gz chromium_src-75001aab2af6da7c04d30daf3019f0dba4982432.tar.bz2 |
aura: change cursor according to drop effects in drag_drop_controller.
BUG=125858
TEST=manual
Review URL: https://chromiumcodereview.appspot.com/10441127
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@139995 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ash/drag_drop/drag_drop_controller.cc')
-rw-r--r-- | ash/drag_drop/drag_drop_controller.cc | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc index 3e4c270..16fcf61 100644 --- a/ash/drag_drop/drag_drop_controller.cc +++ b/ash/drag_drop/drag_drop_controller.cc @@ -116,9 +116,17 @@ void DragDropController::DragUpdate(aura::Window* target, drag_operation_); e.set_flags(event.flags()); int op = delegate->OnDragUpdated(e); - gfx::NativeCursor cursor = (op == ui::DragDropTypes::DRAG_NONE)? - ui::kCursorNoDrop : ui::kCursorCopy; - Shell::GetPrimaryRootWindow()->SetCursor(cursor); + gfx::NativeCursor cursor = ui::kCursorNoDrop; + if (op & ui::DragDropTypes::DRAG_COPY) + cursor = ui::kCursorCopy; + else if (op & ui::DragDropTypes::DRAG_LINK) + cursor = ui::kCursorAlias; + else if (op & ui::DragDropTypes::DRAG_MOVE) + cursor = ui::kCursorMove; + if (drag_window_->GetRootWindow()) + drag_window_->GetRootWindow()->SetCursor(cursor); + else + Shell::GetPrimaryRootWindow()->SetCursor(cursor); } } |