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

Unified Diff: ui/views/controls/combobox/combobox.cc

Issue 2299023003: Activate comboboxes (i.e. open dropdown menu) on Enter and Space. (Closed)
Patch Set: Created 4 years, 4 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/combobox/combobox_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/combobox/combobox.cc
diff --git a/ui/views/controls/combobox/combobox.cc b/ui/views/controls/combobox/combobox.cc
index 0a3affae4424e1cc55111190ec92b260d50f448e..02db354f2f3f1169bac84d7b1d35636894a405e2 100644
--- a/ui/views/controls/combobox/combobox.cc
+++ b/ui/views/controls/combobox/combobox.cc
@@ -601,22 +601,21 @@ bool Combobox::OnKeyPressed(const ui::KeyEvent& e) {
new_index = GetAdjacentIndex(model(), -1, selected_index_);
break;
- // Click the button only when the button style mode.
case ui::VKEY_SPACE:
if (style_ == STYLE_ACTION) {
// When pressing space, the click event will be raised after the key is
// released.
text_button_->SetState(Button::STATE_PRESSED);
} else {
- return false;
+ show_menu = true;
}
break;
- // Click the button only when the button style mode.
case ui::VKEY_RETURN:
- if (style_ != STYLE_ACTION)
- return false;
- OnPerformAction();
+ if (style_ == STYLE_ACTION)
+ OnPerformAction();
+ else
+ show_menu = true;
break;
default:
« no previous file with comments | « no previous file | ui/views/controls/combobox/combobox_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698