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

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: ReleaseCapture if capture was started. 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
« no previous file with comments | « ui/views/controls/button/menu_button.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
+ 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)
« no previous file with comments | « ui/views/controls/button/menu_button.cc ('k') | ui/views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698