| 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..54ceb02c16e7442ef160689f908e6952e859db46 100644
|
| --- a/ash/common/wm/background_animator.cc
|
| +++ b/ash/common/wm/background_animator.cc
|
| @@ -19,7 +19,7 @@ BackgroundAnimator::BackgroundAnimator(BackgroundAnimatorDelegate* delegate,
|
| max_alpha_(max_alpha),
|
| animation_(this),
|
| paints_background_(false),
|
| - alpha_(min_alpha) {
|
| + alpha_(-1) {
|
| animation_.SetSlideDuration(kBackgroundDurationMS);
|
| }
|
|
|
| @@ -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,15 @@ 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, true);
|
| +}
|
| +
|
| +void BackgroundAnimator::AnimationCanceled(const gfx::Animation* animation) {
|
| + delegate_->BackgroundAnimationEnded(this, false);
|
| }
|
|
|
| } // namespace ash
|
|
|