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

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

Issue 484133002: "F4" doesn't close/open the "Folder" dropdown on "Bookmark added!" pop-up. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: modifying comments. Created 6 years, 3 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/controls/menu/menu_controller.cc
diff --git a/ui/views/controls/menu/menu_controller.cc b/ui/views/controls/menu/menu_controller.cc
index 19936f31bcfc12d601386c30ab64b1a583e4fd00..12c5aae5351eb5759e048fc629f9b5e8cc3380c8 100644
--- a/ui/views/controls/menu/menu_controller.cc
+++ b/ui/views/controls/menu/menu_controller.cc
@@ -1034,11 +1034,15 @@ bool MenuController::OnKeyDown(ui::KeyboardCode key_code) {
case ui::VKEY_F4:
if (!is_combobox_)
break;
- // Fallthrough to accept on F4, so combobox menus match Windows behavior.
+ // Fallthrough to accept or dismiss combobox menus on F4, like windows.
case ui::VKEY_RETURN:
if (pending_state_.item) {
if (pending_state_.item->HasSubmenu()) {
- OpenSubmenuChangeSelectionIfCan();
+ if (key_code == ui::VKEY_F4 &&
+ pending_state_.item->GetSubmenu()->IsShowing())
+ return false;
+ else
+ OpenSubmenuChangeSelectionIfCan();
} else {
SendAcceleratorResultType result = SendAcceleratorToHotTrackedView();
if (result == ACCELERATOR_NOT_PROCESSED &&
« 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