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

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

Issue 2720183002: [Views] Update ink drop for omnibox icons (Closed)
Patch Set: Removed CanProcessEventsWithinSubtree 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
« no previous file with comments | « ui/views/controls/button/custom_button.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « ui/views/controls/button/custom_button.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698