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

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

Issue 2720183002: [Views] Update ink drop for omnibox icons (Closed)
Patch Set: Addressed sky's comments Created 3 years, 7 months 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 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);
}

Powered by Google App Engine
This is Rietveld 408576698