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

Unified Diff: ui/views/view.cc

Issue 22934007: linux_aura: Fix crash on drags from the omnibox. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 4 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 | « ui/views/view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/view.cc
diff --git a/ui/views/view.cc b/ui/views/view.cc
index 080df12881d63898fafcc4bb54ed63f7f78764f3..9ff44a98933941d071abe64a0171f4549c111f74 100644
--- a/ui/views/view.cc
+++ b/ui/views/view.cc
@@ -185,6 +185,7 @@ View::View()
accessibility_focusable_(false),
context_menu_controller_(NULL),
drag_controller_(NULL),
+ currently_dragging_(false),
post_dispatch_handler_(new internal::PostEventDispatchHandler(this)),
native_view_accessibility_(NULL) {
AddPostTargetHandler(post_dispatch_handler_.get());
@@ -2318,10 +2319,15 @@ bool View::DoDrag(const ui::LocatedEvent& event,
const gfx::Point& press_pt,
ui::DragDropTypes::DragEventSource source) {
#if !defined(OS_MACOSX)
+ if (currently_dragging_)
+ return false;
+
int drag_operations = GetDragOperations(press_pt);
if (drag_operations == ui::DragDropTypes::DRAG_NONE)
return false;
+ currently_dragging_ = true;
Elliot Glaysher 2013/08/14 21:15:55 I vaguely remember us having some sort of scoped b
sadrul 2013/08/14 21:33:52 I think you mean base::AutoReset.
+
OSExchangeData data;
WriteDragData(press_pt, &data);
@@ -2331,6 +2337,9 @@ bool View::DoDrag(const ui::LocatedEvent& event,
ConvertPointToWidget(this, &widget_location);
GetWidget()->RunShellDrag(this, data, widget_location, drag_operations,
source);
+
+ currently_dragging_ = false;
+
return true;
#else
return false;
« no previous file with comments | « ui/views/view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698