Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(313)

Unified Diff: ash/drag_drop/drag_drop_controller.cc

Issue 10825143: aura: Fix a couple of drag drop issues: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/drag_drop/drag_drop_controller.h ('k') | ui/aura/client/drag_drop_client.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dd8a0971a638a1b75858c277737fc10b2ab34cc8..693472da10c6907be02467d50cf637844fbf5a17 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -64,6 +64,7 @@ int DragDropController::StartDragAndDrop(const ui::OSExchangeData& data,
if (capture_window)
capture_window->ReleaseCapture();
drag_drop_in_progress_ = true;
+ drag_cursor_ = ui::kCursorPointer;
drag_data_ = &data;
drag_operation_ = operation;
@@ -128,6 +129,7 @@ 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);
}
}
@@ -141,6 +143,7 @@ void DragDropController::DragUpdate(aura::Window* target,
void DragDropController::Drop(aura::Window* target,
const aura::LocatedEvent& event) {
+ drag_cursor_ = ui::kCursorPointer;
ash::Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorPointer);
aura::client::DragDropDelegate* delegate = NULL;
@@ -170,6 +173,7 @@ void DragDropController::Drop(aura::Window* target,
}
void DragDropController::DragCancel() {
+ drag_cursor_ = ui::kCursorPointer;
ash::Shell::GetInstance()->cursor_manager()->SetCursor(ui::kCursorPointer);
// |drag_window_| can be NULL if we have just started the drag and have not
@@ -191,6 +195,10 @@ bool DragDropController::IsDragDropInProgress() {
return drag_drop_in_progress_;
}
+gfx::NativeCursor DragDropController::GetDragCursor() {
+ return drag_cursor_;
+}
+
bool DragDropController::PreHandleKeyEvent(aura::Window* target,
aura::KeyEvent* event) {
if (drag_drop_in_progress_ && event->key_code() == ui::VKEY_ESCAPE) {
@@ -211,9 +219,6 @@ bool DragDropController::PreHandleMouseEvent(aura::Window* target,
case ui::ET_MOUSE_RELEASED:
Drop(target, *event);
break;
- case ui::ET_MOUSE_EXITED:
- DragCancel();
- break;
default:
// We could reach here if the user drops outside the root window.
// We could also reach here because RootWindow may sometimes generate a
« no previous file with comments | « ash/drag_drop/drag_drop_controller.h ('k') | ui/aura/client/drag_drop_client.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698