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 c5f602d5a5514378ea06e1378fe535f2db1d5dd9..30faaea832d09c6e737962a4b12be6ef4f479a9a 100644 |
--- a/ui/views/controls/button/custom_button.cc |
+++ b/ui/views/controls/button/custom_button.cc |
@@ -447,6 +447,10 @@ bool CustomButton::IsTriggerableEvent(const ui::Event& event) { |
(triggerable_event_flags_ & event.flags()) != 0); |
} |
+bool CustomButton::ShouldUpdateInkDropOnClickCanceled() const { |
+ return true; |
+} |
+ |
bool CustomButton::ShouldEnterPushedState(const ui::Event& event) { |
return IsTriggerableEvent(event); |
} |
@@ -487,12 +491,14 @@ void CustomButton::NotifyClick(const ui::Event& event) { |
} |
void CustomButton::OnClickCanceled(const ui::Event& event) { |
- if (GetInkDrop()->GetTargetInkDropState() == |
- views::InkDropState::ACTION_PENDING || |
- GetInkDrop()->GetTargetInkDropState() == |
- views::InkDropState::ALTERNATE_ACTION_PENDING) { |
- AnimateInkDrop(views::InkDropState::HIDDEN, |
- ui::LocatedEvent::FromIfValid(&event)); |
+ if (ShouldUpdateInkDropOnClickCanceled()) { |
+ if (GetInkDrop()->GetTargetInkDropState() == |
+ views::InkDropState::ACTION_PENDING || |
+ GetInkDrop()->GetTargetInkDropState() == |
+ views::InkDropState::ALTERNATE_ACTION_PENDING) { |
+ AnimateInkDrop(views::InkDropState::HIDDEN, |
+ ui::LocatedEvent::FromIfValid(&event)); |
+ } |
} |
Button::OnClickCanceled(event); |
} |