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

Unified Diff: ui/views/view.cc

Issue 291273007: Prevent the context menu from showing when long pressing the window controls (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | 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 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();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698