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

Unified Diff: ash/common/wm/background_animator.cc

Issue 2053113002: Replaced BackgroundAnimator with ShelfBackgroundAnimator. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Merge branch 'master' into animate_shelf_chip_backgrounds Created 4 years, 5 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 | « ash/common/wm/background_animator.h ('k') | ash/common/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/common/wm/background_animator.cc
diff --git a/ash/common/wm/background_animator.cc b/ash/common/wm/background_animator.cc
index b8596fb2760f91933d828cadf0c51269cc526e56..ed13bbba6c9001758c3e25fe7fcadc87da7d41ef 100644
--- a/ash/common/wm/background_animator.cc
+++ b/ash/common/wm/background_animator.cc
@@ -29,6 +29,10 @@ void BackgroundAnimator::SetDuration(int time_in_ms) {
animation_.SetSlideDuration(time_in_ms);
}
+void BackgroundAnimator::Stop() {
+ animation_.Stop();
+}
+
void BackgroundAnimator::SetPaintsBackground(
bool value,
BackgroundAnimatorChangeType type) {
@@ -38,6 +42,7 @@ void BackgroundAnimator::SetPaintsBackground(
if (type == BACKGROUND_CHANGE_IMMEDIATE && !animation_.is_animating()) {
animation_.Reset(value ? 1.0f : 0.0f);
AnimationProgressed(&animation_);
+ AnimationEnded(&animation_);
return;
}
if (paints_background_)
@@ -51,7 +56,11 @@ void BackgroundAnimator::AnimationProgressed(const gfx::Animation* animation) {
if (alpha_ == alpha)
return;
alpha_ = alpha;
- delegate_->UpdateBackground(alpha_);
+ delegate_->UpdateBackground(this, alpha_);
+}
+
+void BackgroundAnimator::AnimationEnded(const gfx::Animation* animation) {
+ delegate_->BackgroundAnimationEnded(this);
}
} // namespace ash
« no previous file with comments | « ash/common/wm/background_animator.h ('k') | ash/common/wm/dock/docked_window_layout_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698