| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ash/shelf/background_animator.h" | 5 #include "ash/shelf/background_animator.h" |
| 6 | 6 |
| 7 | |
| 8 namespace ash { | 7 namespace ash { |
| 9 namespace { | 8 namespace { |
| 10 | 9 |
| 11 // Duration of the background animation. | 10 // Duration of the background animation. |
| 12 const int kBackgroundDurationMS = 1000; | 11 const int kBackgroundDurationMS = 1000; |
| 13 | 12 |
| 14 } | 13 } |
| 15 | 14 |
| 16 BackgroundAnimator::BackgroundAnimator(BackgroundAnimatorDelegate* delegate, | 15 BackgroundAnimator::BackgroundAnimator(BackgroundAnimatorDelegate* delegate, |
| 17 int min_alpha, | 16 int min_alpha, |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 50 | 49 |
| 51 void BackgroundAnimator::AnimationProgressed(const gfx::Animation* animation) { | 50 void BackgroundAnimator::AnimationProgressed(const gfx::Animation* animation) { |
| 52 int alpha = animation->CurrentValueBetween(min_alpha_, max_alpha_); | 51 int alpha = animation->CurrentValueBetween(min_alpha_, max_alpha_); |
| 53 if (alpha_ == alpha) | 52 if (alpha_ == alpha) |
| 54 return; | 53 return; |
| 55 alpha_ = alpha; | 54 alpha_ = alpha; |
| 56 delegate_->UpdateBackground(alpha_); | 55 delegate_->UpdateBackground(alpha_); |
| 57 } | 56 } |
| 58 | 57 |
| 59 } // namespace ash | 58 } // namespace ash |
| OLD | NEW |