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

Unified Diff: ash/drag_drop/drag_drop_controller.cc

Issue 10388105: aura: Fix a couple of bug (really the same bug at two different places) for drag (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 7 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 | « no previous file | ash/drag_drop/drag_drop_controller_unittest.cc » ('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 6c2348bf037368dcce6eb9106c98ac99bcb1df03..1bff88aea564133dad3ef09aafd4bb643b8b4f37 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -131,10 +131,13 @@ void DragDropController::Drop(aura::Window* target,
Shell::GetRootWindow()->SetCursor(ui::kCursorPointer);
aura::client::DragDropDelegate* delegate = NULL;
- // |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
- // a drag/drop. Otherwise, target should be equal to the |drag_window_|.
- DCHECK(target == drag_window_ || !drag_window_);
+ // We must guarantee that a target gets a OnDragEntered before Drop. WebKit
+ // depends on not getting a Drop without DragEnter. This behavior is
+ // consistent with drag/drop on other platforms.
+ if (target != drag_window_)
+ DragUpdate(target, event);
+ DCHECK(target == drag_window_);
+
if ((delegate = aura::client::GetDragDropDelegate(target))) {
aura::DropTargetEvent e(
*drag_data_, event.location(), event.root_location(), drag_operation_);
« no previous file with comments | « no previous file | ash/drag_drop/drag_drop_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698