Index: ui/views/view.cc |
diff --git a/ui/views/view.cc b/ui/views/view.cc |
index 36354a5fa816f314b5179fd7a6ee94ec03ba9c5a..9a6d475729dc18c87070d1c3e8785d65f580df3f 100644 |
--- a/ui/views/view.cc |
+++ b/ui/views/view.cc |
@@ -107,14 +107,18 @@ class PostEventDispatchHandler : public ui::EventHandler { |
return; |
if (touch_dnd_enabled_) { |
- if (event->type() == ui::ET_GESTURE_LONG_PRESS && |
- (!owner_->drag_controller() || |
- owner_->drag_controller()->CanStartDragForView( |
- owner_, event->location(), event->location()))) { |
- if (owner_->DoDrag(*event, event->location(), |
- ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH)) { |
- event->StopPropagation(); |
- return; |
+ if (event->type() == ui::ET_GESTURE_LONG_PRESS) { |
+ gfx::Point location(event->location()); |
+ View::ConvertPointToTarget(static_cast<View*>(event->target()), |
+ owner_, &location); |
+ if (!owner_->drag_controller() || |
+ owner_->drag_controller()->CanStartDragForView( |
+ owner_, location, location)) { |
+ if (owner_->DoDrag(*event, location, |
+ ui::DragDropTypes::DRAG_EVENT_SOURCE_TOUCH)) { |
+ event->StopPropagation(); |
+ return; |
+ } |
} |
} |
} |
@@ -124,7 +128,8 @@ class PostEventDispatchHandler : public ui::EventHandler { |
event->type() == ui::ET_GESTURE_LONG_TAP || |
event->type() == ui::ET_GESTURE_TWO_FINGER_TAP)) { |
gfx::Point location(event->location()); |
- View::ConvertPointToScreen(owner_, &location); |
+ View::ConvertPointToScreen( |
+ static_cast<View*>(event->target()), &location); |
owner_->ShowContextMenu(location, ui::MENU_SOURCE_TOUCH); |
event->StopPropagation(); |
} |