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

Unified Diff: ui/views/animation/ink_drop_ripple.cc

Issue 2250783002: Allow InkDropRipple to co-exist with highlight (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 4 years, 3 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/animation/ink_drop_ripple.cc
diff --git a/ui/views/animation/ink_drop_ripple.cc b/ui/views/animation/ink_drop_ripple.cc
index 06e38439bbe145737f01b123ec89bfc7f3e6ac74..082e7576fa411e42e66868e297360b8ec5f8d32f 100644
--- a/ui/views/animation/ink_drop_ripple.cc
+++ b/ui/views/animation/ink_drop_ripple.cc
@@ -31,6 +31,9 @@ InkDropRipple::InkDropRipple()
InkDropRipple::~InkDropRipple() {}
void InkDropRipple::AnimateToState(InkDropState ink_drop_state) {
+ if (!GetRootLayer())
+ return;
+
// Does not return early if |target_ink_drop_state_| == |ink_drop_state| for
// two reasons.
// 1. The attached observers must be notified of all animations started and
@@ -68,6 +71,9 @@ void InkDropRipple::AnimateToState(InkDropState ink_drop_state) {
}
void InkDropRipple::SnapToActivated() {
+ if (!GetRootLayer())
+ return;
+
AbortAllAnimations();
// |animation_observer| will be deleted when AnimationEndedCallback() returns
// true.
@@ -84,6 +90,10 @@ void InkDropRipple::SnapToActivated() {
animation_observer->SetActive();
}
+bool InkDropRipple::IsVisible() {
+ return GetRootLayer() && GetRootLayer()->visible();
+}
+
void InkDropRipple::HideImmediately() {
AbortAllAnimations();
SetStateToHidden();

Powered by Google App Engine
This is Rietveld 408576698