summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvarunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-20 19:56:53 +0000
committervarunjain@chromium.org <varunjain@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-20 19:56:53 +0000
commitb62986f02d8017d33f3caf4ffe1b5ca228375122 (patch)
treefd9945c0013379a1e4319755de466b9638b39da9
parent2399aa53835f2d4b554956ab13e0c6ae646d29b4 (diff)
downloadchromium_src-b62986f02d8017d33f3caf4ffe1b5ca228375122.zip
chromium_src-b62986f02d8017d33f3caf4ffe1b5ca228375122.tar.gz
chromium_src-b62986f02d8017d33f3caf4ffe1b5ca228375122.tar.bz2
Fix a couple of drag drop bugs:
1. When dragging over BrowserRootView, we must sanitize the dragged string before querying Autocomplete. 2. We may receive un-expected events during drag drop session if the user moves out of the root window. BUG=110733 TEST=chrome no longer crashes on drag drop. Review URL: http://codereview.chromium.org/9270001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@118470 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/drag_drop/drag_drop_controller.cc5
-rw-r--r--chrome/browser/ui/views/frame/browser_root_view.cc3
2 files changed, 6 insertions, 2 deletions
diff --git a/ash/drag_drop/drag_drop_controller.cc b/ash/drag_drop/drag_drop_controller.cc
index cfb12db..c2db4ac 100644
--- a/ash/drag_drop/drag_drop_controller.cc
+++ b/ash/drag_drop/drag_drop_controller.cc
@@ -122,6 +122,7 @@ void DragDropController::DragUpdate(aura::Window* target,
void DragDropController::Drop(aura::Window* target,
const aura::MouseEvent& event) {
+ RootWindow::GetInstance()->SetCursor(aura::kCursorPointer);
aura::client::DragDropDelegate* delegate = NULL;
DCHECK(target == dragged_window_);
if ((delegate = aura::client::GetDragDropDelegate(dragged_window_))) {
@@ -141,6 +142,7 @@ void DragDropController::Drop(aura::Window* target,
}
void DragDropController::DragCancel() {
+ RootWindow::GetInstance()->SetCursor(aura::kCursorPointer);
Cleanup();
drag_operation_ = 0;
StartCanceledAnimation();
@@ -172,7 +174,8 @@ bool DragDropController::PreHandleMouseEvent(aura::Window* target,
DragCancel();
break;
default:
- NOTREACHED();
+ // We could reach here if the user drops outside the root window.
+ DragCancel();
break;
}
return true;
diff --git a/chrome/browser/ui/views/frame/browser_root_view.cc b/chrome/browser/ui/views/frame/browser_root_view.cc
index ae99229..790a0648 100644
--- a/chrome/browser/ui/views/frame/browser_root_view.cc
+++ b/chrome/browser/ui/views/frame/browser_root_view.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -157,6 +157,7 @@ bool BrowserRootView::GetPasteAndGoURL(const ui::OSExchangeData& data,
string16 text;
if (!data.GetString(&text) || text.empty())
return false;
+ text = AutocompleteMatch::SanitizeString(text);
AutocompleteMatch match;
browser_view_->browser()->profile()->GetAutocompleteClassifier()->Classify(