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 && |