Index: ash/drag_drop/drag_drop_controller.cc |
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc |
index eb33f3d2d98dab8d83fa55e53ac5edc461fd6061..b76ca955c8ea70fe96b2a33bdd4995110011aeca 100644 |
--- a/ash/drag_drop/drag_drop_controller.cc |
+++ b/ash/drag_drop/drag_drop_controller.cc |
@@ -62,7 +62,7 @@ int DragDropController::StartDragAndDrop(const ui::OSExchangeData& data, |
int operation) { |
DCHECK(!IsDragDropInProgress()); |
- drag_cursor_ = ui::kCursorPointer; |
+ SetDragCursor(ui::kCursorPointer); |
drag_drop_tracker_.reset(new DragDropTracker(root_window)); |
drag_data_ = &data; |
@@ -128,8 +128,8 @@ void DragDropController::DragUpdate(aura::Window* target, |
cursor = ui::kCursorAlias; |
else if (op & ui::DragDropTypes::DRAG_MOVE) |
cursor = ui::kCursorMove; |
- drag_cursor_ = cursor; |
- ash::Shell::GetInstance()->cursor_manager()->SetCursor(cursor); |
+ SetDragCursor(cursor); |
+ ash::Shell::GetInstance()->cursor_manager()->SetCursor(drag_cursor_); |
} |
} |
@@ -145,7 +145,7 @@ void DragDropController::DragUpdate(aura::Window* target, |
void DragDropController::Drop(aura::Window* target, |
const ui::LocatedEvent& event) { |
- drag_cursor_ = ui::kCursorPointer; |
+ SetDragCursor(ui::kCursorPointer); |
ash::Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorPointer); |
aura::client::DragDropDelegate* delegate = NULL; |
@@ -175,8 +175,8 @@ void DragDropController::Drop(aura::Window* target, |
} |
void DragDropController::DragCancel() { |
- drag_cursor_ = ui::kCursorPointer; |
- ash::Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorPointer); |
+ SetDragCursor(ui::kCursorPointer); |
Daniel Erat
2012/09/06 23:47:15
Can SetDragCursor() just call ash::Shell::GetInsta
mazda
2012/09/07 02:20:57
It turned out that we don't need to set drag_curso
|
+ ash::Shell::GetInstance()->cursor_manager()->SetCursor(drag_cursor_); |
// |drag_window_| can be NULL if we have just started the drag and have not |
// received any DragUpdates, or, if the |drag_window_| gets destroyed during |
@@ -311,5 +311,10 @@ void DragDropController::Cleanup() { |
drag_drop_tracker_.Pass(); |
} |
+void DragDropController::SetDragCursor(gfx::NativeCursor cursor) { |
+ drag_cursor_ = ash::Shell::GetInstance()->cursor_manager()-> |
+ GetCursorFromNativeType(cursor); |
+} |
+ |
} // namespace internal |
} // namespace ash |