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

Unified Diff: ui/views/controls/button/menu_button.cc

Issue 1671323002: [UI Views] Handle accelerators being pressed for buttons inside a menu (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Latest master Created 4 years, 10 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.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/button/menu_button.cc
diff --git a/ui/views/controls/button/menu_button.cc b/ui/views/controls/button/menu_button.cc
index 32cfd9c2a23818452c0c9cb98327352e39696b42..c7a53389a142840e66c7e50d712db0d25fb0ee2d 100644
--- a/ui/views/controls/button/menu_button.cc
+++ b/ui/views/controls/button/menu_button.cc
@@ -271,6 +271,13 @@ bool MenuButton::OnKeyReleased(const ui::KeyEvent& event) {
return false;
}
+bool MenuButton::AcceleratorPressed(const ui::Accelerator& accelerator) {
+ // CustomButton::AcceleratorPressed ends up in NotifyClick, which doesn't work
+ // for menu buttons.
+ Activate();
+ return true;
+}
+
void MenuButton::GetAccessibleState(ui::AXViewState* state) {
CustomButton::GetAccessibleState(state);
state->role = ui::AX_ROLE_POP_UP_BUTTON;
« no previous file with comments | « ui/views/controls/button/menu_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698