| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 CHROME_COMMON_SLIDE_ANIMATION_H_ | 5 #ifndef CHROME_COMMON_SLIDE_ANIMATION_H_ |
| 6 #define CHROME_COMMON_SLIDE_ANIMATION_H_ | 6 #define CHROME_COMMON_SLIDE_ANIMATION_H_ |
| 7 | 7 |
| 8 #include "chrome/common/animation.h" | 8 #include "chrome/common/animation.h" |
| 9 | 9 |
| 10 // Slide Animation | 10 // Slide Animation |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 virtual void Hide(); | 66 virtual void Hide(); |
| 67 | 67 |
| 68 // Sets the time a slide will take. Note that this isn't actually | 68 // Sets the time a slide will take. Note that this isn't actually |
| 69 // the amount of time an animation will take as the current value of | 69 // the amount of time an animation will take as the current value of |
| 70 // the slide is considered. | 70 // the slide is considered. |
| 71 virtual void SetSlideDuration(int duration) { slide_duration_ = duration; } | 71 virtual void SetSlideDuration(int duration) { slide_duration_ = duration; } |
| 72 int GetSlideDuration() const { return slide_duration_; } | 72 int GetSlideDuration() const { return slide_duration_; } |
| 73 void SetTweenType(TweenType tween_type) { tween_type_ = tween_type; } | 73 void SetTweenType(TweenType tween_type) { tween_type_ = tween_type; } |
| 74 | 74 |
| 75 double GetCurrentValue() const { return value_current_; } | 75 double GetCurrentValue() const { return value_current_; } |
| 76 bool IsShowing() { return showing_; } | 76 bool IsShowing() const { return showing_; } |
| 77 | 77 |
| 78 private: | 78 private: |
| 79 // Overridden from Animation. | 79 // Overridden from Animation. |
| 80 void AnimateToState(double state); | 80 void AnimateToState(double state); |
| 81 | 81 |
| 82 AnimationDelegate* target_; | 82 AnimationDelegate* target_; |
| 83 | 83 |
| 84 TweenType tween_type_; | 84 TweenType tween_type_; |
| 85 | 85 |
| 86 // Used to determine which way the animation is going. | 86 // Used to determine which way the animation is going. |
| 87 bool showing_; | 87 bool showing_; |
| 88 | 88 |
| 89 // Animation values. These are a layer on top of Animation::state_ to | 89 // Animation values. These are a layer on top of Animation::state_ to |
| 90 // provide the reversability. | 90 // provide the reversability. |
| 91 double value_start_; | 91 double value_start_; |
| 92 double value_end_; | 92 double value_end_; |
| 93 double value_current_; | 93 double value_current_; |
| 94 | 94 |
| 95 // How long a hover in/out animation will last for. This defaults to | 95 // How long a hover in/out animation will last for. This defaults to |
| 96 // kHoverFadeDurationMS, but can be overridden with SetDuration. | 96 // kHoverFadeDurationMS, but can be overridden with SetDuration. |
| 97 int slide_duration_; | 97 int slide_duration_; |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 #endif // CHROME_COMMON_SLIDE_ANIMATION_H_ | 100 #endif // CHROME_COMMON_SLIDE_ANIMATION_H_ |
| OLD | NEW |