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 e8ce4a003e394c3ff8f5ae260888f8806ddf8b1c..30ac579aebf39f3f3bd0ecb3363eab262f784481 100644 |
--- a/ui/views/controls/button/custom_button.cc |
+++ b/ui/views/controls/button/custom_button.cc |
@@ -265,8 +265,9 @@ bool CustomButton::AcceleratorPressed(const ui::Accelerator& accelerator) { |
// Should only handle accelerators when active. However, only top level |
// widgets can be active, so for child widgets check if they are focused |
// instead. |
- if ((IsChildWidget() && !FocusInChildWidget()) || |
- (!IsChildWidget() && !GetWidget()->IsActive())) { |
+ if (!ShouldHandleAcceleratorWhenInactive() && |
+ ((IsChildWidget() && !FocusInChildWidget()) || |
+ (!IsChildWidget() && !GetWidget()->IsActive()))) { |
return false; |
} |
SetState(STATE_NORMAL); |
@@ -361,6 +362,10 @@ bool CustomButton::ShouldEnterPushedState(const ui::Event& event) { |
return IsTriggerableEvent(event); |
} |
+bool CustomButton::ShouldHandleAcceleratorWhenInactive() { |
+ return false; |
+} |
+ |
bool CustomButton::ShouldEnterHoveredState() { |
if (!visible()) |
return false; |