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 cdf6a6d620cc2e3373c983c16ac98b4d4dd75c3d..93cfddfb11751098cd2f20de4240496b3bb0f517 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()) { |
sky
2017/05/12 13:11:48
If this returns false, how is the ink drop updated
spqchan
2017/05/18 01:13:05
The ink drop gets updated by the subclass. I added
|
+ 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); |
} |