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

Unified Diff: ui/views/controls/menu/menu_controller.cc

Issue 10534092: Add touch gestures to views menu controls. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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: ui/views/controls/menu/menu_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index ce1adc2714da2f8e2b1693ec22f46bd0a3cbcd93..9109602e247e3052a7c94130ee15fe2c9430f40f 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -543,6 +543,14 @@ ui::GestureStatus MenuController::OnGestureEvent(SubmenuView* source,
} else if (event.type() == ui::ET_GESTURE_LONG_PRESS && possible_drag_) {
StartDrag(source, event.location());
return ui::GESTURE_STATUS_CONSUMED;
+ } else if (event.type() == ui::ET_GESTURE_TAP) {
sadrul 2012/06/11 16:00:37 I think if something (e.g. a button) causes the me
+ if (pending_state_.item) {
+ if (pending_state_.item->HasSubmenu())
+ OpenSubmenuChangeSelectionIfCan();
+ else if (pending_state_.item->enabled())
+ Accept(pending_state_.item, 0);
+ return ui::GESTURE_STATUS_CONSUMED;
+ }
}
MenuPart part = GetMenuPart(source, event.location());
if (!part.submenu)

Powered by Google App Engine
This is Rietveld 408576698