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

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

Issue 1437523005: Custom buttons should only handle accelerators when focused. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: msw comments Created 5 years, 1 month 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
Index: ui/views/controls/button/custom_button.cc
diff --git a/ui/views/controls/button/custom_button.cc b/ui/views/controls/button/custom_button.cc
index 61b595bbfeb2f059327527ad3c1ef18e76afb270..056a83764473bc248edb80a6f0b7b5d9482404ed 100644
--- a/ui/views/controls/button/custom_button.cc
+++ b/ui/views/controls/button/custom_button.cc
@@ -251,6 +251,8 @@ void CustomButton::OnGestureEvent(ui::GestureEvent* event) {
}
bool CustomButton::AcceleratorPressed(const ui::Accelerator& accelerator) {
+ if (GetWidget() && !GetWidget()->IsActive())
sky 2015/11/11 18:54:01 Actually, how is the button getting the accelerato
meacer 2015/11/12 00:37:32 One of the failing tests has this scenario: Constr
+ return false;
SetState(STATE_NORMAL);
// TODO(beng): remove once NotifyClick takes ui::Event.
ui::MouseEvent synthetic_event(
« no previous file with comments | « no previous file | ui/views/controls/button/custom_button_unittest.cc » ('j') | ui/views/controls/button/custom_button_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698