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

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

Issue 1757993004: Added ink drop hover/ripple to menu hosting bookmark buttons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sky@ & varkha@ comments. Created 4 years, 9 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/animation/ink_drop_animation.h ('k') | ui/views/animation/ink_drop_animation_controller.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/animation/ink_drop_animation.cc
diff --git a/ui/views/animation/ink_drop_animation.cc b/ui/views/animation/ink_drop_animation.cc
index 2f55a25ff594093d3b5312d5d640ad42ffb022a1..3f04376dd66c70cbb44c57532b2980f58e52efd1 100644
--- a/ui/views/animation/ink_drop_animation.cc
+++ b/ui/views/animation/ink_drop_animation.cc
@@ -68,6 +68,23 @@ void InkDropAnimation::AnimateToState(InkDropState ink_drop_state) {
// AnimationEndedCallback which can delete |this|.
}
+void InkDropAnimation::SnapToActivated() {
+ AbortAllAnimations();
+ // |animation_observer| will be deleted when AnimationEndedCallback() returns
+ // true.
+ // TODO(bruthig): Implement a safer ownership model for the
+ // |animation_observer|.
+ ui::CallbackLayerAnimationObserver* animation_observer =
+ new ui::CallbackLayerAnimationObserver(
+ base::Bind(&InkDropAnimation::AnimationStartedCallback,
+ base::Unretained(this), InkDropState::ACTIVATED),
+ base::Bind(&InkDropAnimation::AnimationEndedCallback,
+ base::Unretained(this), InkDropState::ACTIVATED));
+ GetRootLayer()->SetVisible(true);
+ target_ink_drop_state_ = InkDropState::ACTIVATED;
+ animation_observer->SetActive();
+}
+
void InkDropAnimation::HideImmediately() {
AbortAllAnimations();
SetStateToHidden();
« no previous file with comments | « ui/views/animation/ink_drop_animation.h ('k') | ui/views/animation/ink_drop_animation_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698