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

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: 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
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 5a3f7df11af78d713f00ca394ac9db092a8542c5..c4dff4f22d5586e1dd59f625f714cd3f80901dcc 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') | content/browser/web_contents/web_contents_view_aura.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698