| 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 #ifndef ASH_WM_COMMON_BACKGROUND_ANIMATOR_H_ | 5 #ifndef ASH_WM_COMMON_BACKGROUND_ANIMATOR_H_ |
| 6 #define ASH_WM_COMMON_BACKGROUND_ANIMATOR_H_ | 6 #define ASH_WM_COMMON_BACKGROUND_ANIMATOR_H_ |
| 7 | 7 |
| 8 #include "ash/wm/common/ash_wm_common_export.h" | 8 #include "ash/ash_export.h" |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "ui/gfx/animation/animation_delegate.h" | 10 #include "ui/gfx/animation/animation_delegate.h" |
| 11 #include "ui/gfx/animation/slide_animation.h" | 11 #include "ui/gfx/animation/slide_animation.h" |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 | 14 |
| 15 // How the background can be changed. | 15 // How the background can be changed. |
| 16 enum BackgroundAnimatorChangeType { | 16 enum BackgroundAnimatorChangeType { |
| 17 BACKGROUND_CHANGE_ANIMATE, | 17 BACKGROUND_CHANGE_ANIMATE, |
| 18 BACKGROUND_CHANGE_IMMEDIATE | 18 BACKGROUND_CHANGE_IMMEDIATE |
| 19 }; | 19 }; |
| 20 | 20 |
| 21 // Delegate is notified any time the background changes. | 21 // Delegate is notified any time the background changes. |
| 22 class ASH_WM_COMMON_EXPORT BackgroundAnimatorDelegate { | 22 class ASH_EXPORT BackgroundAnimatorDelegate { |
| 23 public: | 23 public: |
| 24 virtual void UpdateBackground(int alpha) = 0; | 24 virtual void UpdateBackground(int alpha) = 0; |
| 25 | 25 |
| 26 protected: | 26 protected: |
| 27 virtual ~BackgroundAnimatorDelegate() {} | 27 virtual ~BackgroundAnimatorDelegate() {} |
| 28 }; | 28 }; |
| 29 | 29 |
| 30 // BackgroundAnimator is used by the shelf to animate the background (alpha). | 30 // BackgroundAnimator is used by the shelf to animate the background (alpha). |
| 31 class ASH_WM_COMMON_EXPORT BackgroundAnimator : public gfx::AnimationDelegate { | 31 class ASH_EXPORT BackgroundAnimator : public gfx::AnimationDelegate { |
| 32 public: | 32 public: |
| 33 BackgroundAnimator(BackgroundAnimatorDelegate* delegate, | 33 BackgroundAnimator(BackgroundAnimatorDelegate* delegate, |
| 34 int min_alpha, | 34 int min_alpha, |
| 35 int max_alpha); | 35 int max_alpha); |
| 36 ~BackgroundAnimator() override; | 36 ~BackgroundAnimator() override; |
| 37 | 37 |
| 38 // Sets the transition time in ms. | 38 // Sets the transition time in ms. |
| 39 void SetDuration(int time_in_ms); | 39 void SetDuration(int time_in_ms); |
| 40 | 40 |
| 41 // Sets whether a background is rendered. Initial value is false. If |type| | 41 // Sets whether a background is rendered. Initial value is false. If |type| |
| (...skipping 21 matching lines...) Expand all Loading... |
| 63 | 63 |
| 64 // Current alpha value of the background. | 64 // Current alpha value of the background. |
| 65 int alpha_; | 65 int alpha_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(BackgroundAnimator); | 67 DISALLOW_COPY_AND_ASSIGN(BackgroundAnimator); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 } // namespace ash | 70 } // namespace ash |
| 71 | 71 |
| 72 #endif // ASH_WM_COMMON_BACKGROUND_ANIMATOR_H_ | 72 #endif // ASH_WM_COMMON_BACKGROUND_ANIMATOR_H_ |
| OLD | NEW |