| 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 7664f615332918ad415186babc7dc628cbfe803c..866b4bd6167765926016f1d4ddca09d05ea7b876 100644
|
| --- a/ui/views/controls/button/custom_button.cc
|
| +++ b/ui/views/controls/button/custom_button.cc
|
| @@ -241,12 +241,12 @@ bool CustomButton::OnKeyPressed(const ui::KeyEvent& event) {
|
| }
|
|
|
| bool CustomButton::OnKeyReleased(const ui::KeyEvent& event) {
|
| - if ((state_ == STATE_DISABLED) || (event.key_code() != ui::VKEY_SPACE))
|
| - return false;
|
| -
|
| - SetState(STATE_NORMAL);
|
| - NotifyClick(event);
|
| - return true;
|
| + if ((state_ == STATE_PRESSED) && (event.key_code() == ui::VKEY_SPACE)) {
|
| + SetState(STATE_NORMAL);
|
| + NotifyClick(event);
|
| + return true;
|
| + }
|
| + return false;
|
| }
|
|
|
| void CustomButton::OnGestureEvent(ui::GestureEvent* event) {
|
| @@ -371,8 +371,13 @@ void CustomButton::ViewHierarchyChanged(
|
|
|
| void CustomButton::OnBlur() {
|
| Button::OnBlur();
|
| - if (IsHotTracked())
|
| + if (IsHotTracked() || state_ == STATE_PRESSED) {
|
| SetState(STATE_NORMAL);
|
| + if (ink_drop_delegate() &&
|
| + ink_drop_delegate()->GetTargetInkDropState() !=
|
| + views::InkDropState::HIDDEN)
|
| + ink_drop_delegate()->OnAction(views::InkDropState::HIDDEN);
|
| + }
|
| }
|
|
|
| bool CustomButton::ShouldShowInkDropForFocus() const {
|
|
|