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

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

Issue 1230163004: Selects last item in a menu when pressing 'up' initially (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Selects last item in a menu when pressing 'up' initially Created 5 years, 5 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 | ui/views/controls/menu/menu_controller_unittest.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 54d3410bdd8508a9c8e34d20036bacfa330a401f..60007081adbb776d149b79c53556616110269aef 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -1907,7 +1907,10 @@ void MenuController::IncrementSelection(int delta) {
MenuItemView* to_select = FindFirstSelectableMenuItem(item);
sadrul 2015/07/14 04:17:41 Hm. Perhaps we could add delta to FindFirstSelecta
varkha 2015/07/14 16:22:54 Done.
if (to_select)
SetSelection(to_select, SELECTION_DEFAULT);
- return;
+ if (delta == 1 || !to_select)
+ return;
+ // When decrementing fall through to select a previous item.
+ item = to_select;
}
}
« no previous file with comments | « no previous file | ui/views/controls/menu/menu_controller_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698