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_LAUNCHER_BACKGROUND_ANIMATOR_H_ | 5 #ifndef ASH_LAUNCHER_BACKGROUND_ANIMATOR_H_ |
6 #define ASH_LAUNCHER_BACKGROUND_ANIMATOR_H_ | 6 #define ASH_LAUNCHER_BACKGROUND_ANIMATOR_H_ |
7 | 7 |
8 #include "ash/ash_export.h" | 8 #include "ash/ash_export.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "ui/base/animation/animation_delegate.h" | 10 #include "ui/base/animation/animation_delegate.h" |
(...skipping 23 matching lines...) Expand all Loading... |
34 | 34 |
35 BackgroundAnimator(BackgroundAnimatorDelegate* delegate, | 35 BackgroundAnimator(BackgroundAnimatorDelegate* delegate, |
36 int min_alpha, | 36 int min_alpha, |
37 int max_alpha); | 37 int max_alpha); |
38 virtual ~BackgroundAnimator(); | 38 virtual ~BackgroundAnimator(); |
39 | 39 |
40 // Sets whether a background is rendered. Initial value is false. If |type| | 40 // Sets whether a background is rendered. Initial value is false. If |type| |
41 // is |CHANGE_IMMEDIATE| and an animation is not in progress this notifies | 41 // is |CHANGE_IMMEDIATE| and an animation is not in progress this notifies |
42 // the delegate immediately (synchronously from this method). | 42 // the delegate immediately (synchronously from this method). |
43 void SetPaintsBackground(bool value, ChangeType type); | 43 void SetPaintsBackground(bool value, ChangeType type); |
| 44 bool paints_background() const { return paints_background_; } |
44 | 45 |
45 // Current alpha. | 46 // Current alpha. |
46 int alpha() const { return alpha_; } | 47 int alpha() const { return alpha_; } |
47 | 48 |
48 // ui::AnimationDelegate overrides: | 49 // ui::AnimationDelegate overrides: |
49 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 50 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
50 | 51 |
51 private: | 52 private: |
52 BackgroundAnimatorDelegate* delegate_; | 53 BackgroundAnimatorDelegate* delegate_; |
53 | 54 |
54 const int min_alpha_; | 55 const int min_alpha_; |
55 const int max_alpha_; | 56 const int max_alpha_; |
56 | 57 |
57 ui::SlideAnimation animation_; | 58 ui::SlideAnimation animation_; |
58 | 59 |
59 // Whether the background is painted. | 60 // Whether the background is painted. |
60 bool paints_background_; | 61 bool paints_background_; |
61 | 62 |
62 // Current alpha value of the background. | 63 // Current alpha value of the background. |
63 int alpha_; | 64 int alpha_; |
64 | 65 |
65 DISALLOW_COPY_AND_ASSIGN(BackgroundAnimator); | 66 DISALLOW_COPY_AND_ASSIGN(BackgroundAnimator); |
66 }; | 67 }; |
67 | 68 |
68 } // namespace internal | 69 } // namespace internal |
69 } // namespace ash | 70 } // namespace ash |
70 | 71 |
71 #endif // ASH_LAUNCHER_BACKGROUND_ANIMATOR_H_ | 72 #endif // ASH_LAUNCHER_BACKGROUND_ANIMATOR_H_ |
OLD | NEW |