Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1366)

Side by Side Diff: app/slide_animation.h

Issue 1575011: Adds AnimationContainer, which can be used to group a set of (Closed)
Patch Set: Incorporated review feedback Created 10 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 APP_SLIDE_ANIMATION_H_ 5 #ifndef APP_SLIDE_ANIMATION_H_
6 #define APP_SLIDE_ANIMATION_H_ 6 #define APP_SLIDE_ANIMATION_H_
7 7
8 #include "app/animation.h" 8 #include "app/animation.h"
9 9
10 // Slide Animation 10 // Slide Animation
(...skipping 25 matching lines...) Expand all
36 // void Layout() { 36 // void Layout() {
37 // if (animation_->IsAnimating()) { 37 // if (animation_->IsAnimating()) {
38 // hover_image_.SetOpacity(animation_->GetCurrentValue()); 38 // hover_image_.SetOpacity(animation_->GetCurrentValue());
39 // } 39 // }
40 // } 40 // }
41 // private: 41 // private:
42 // scoped_ptr<SlideAnimation> animation_; 42 // scoped_ptr<SlideAnimation> animation_;
43 // } 43 // }
44 class SlideAnimation : public Animation { 44 class SlideAnimation : public Animation {
45 public: 45 public:
46 explicit SlideAnimation(AnimationDelegate* target);
47 virtual ~SlideAnimation();
48
49 enum TweenType { 46 enum TweenType {
50 NONE, // Linear. 47 NONE, // Linear.
51 EASE_OUT, // Fast in, slow out (default). 48 EASE_OUT, // Fast in, slow out (default).
52 EASE_IN, // Slow in, fast out. 49 EASE_IN, // Slow in, fast out.
53 EASE_IN_OUT, // Slow in and out, fast in the middle. 50 EASE_IN_OUT, // Slow in and out, fast in the middle.
54 FAST_IN_OUT, // Fast in and out, slow in the middle. 51 FAST_IN_OUT, // Fast in and out, slow in the middle.
55 EASE_OUT_SNAP, // Fast in, slow out, snap to final value. 52 EASE_OUT_SNAP, // Fast in, slow out, snap to final value.
56 }; 53 };
57 54
55 explicit SlideAnimation(AnimationDelegate* target);
56 virtual ~SlideAnimation();
57
58 // Set the animation back to the 0 state. 58 // Set the animation back to the 0 state.
59 virtual void Reset(); 59 virtual void Reset();
60 virtual void Reset(double value); 60 virtual void Reset(double value);
61 61
62 // Begin a showing animation or reverse a hiding animation in progress. 62 // Begin a showing animation or reverse a hiding animation in progress.
63 virtual void Show(); 63 virtual void Show();
64 64
65 // Begin a hiding animation or reverse a showing animation in progress. 65 // Begin a hiding animation or reverse a showing animation in progress.
66 virtual void Hide(); 66 virtual void Hide();
67 67
(...skipping 26 matching lines...) Expand all
94 double value_current_; 94 double value_current_;
95 95
96 // How long a hover in/out animation will last for. This defaults to 96 // How long a hover in/out animation will last for. This defaults to
97 // kHoverFadeDurationMS, but can be overridden with SetDuration. 97 // kHoverFadeDurationMS, but can be overridden with SetDuration.
98 int slide_duration_; 98 int slide_duration_;
99 99
100 DISALLOW_COPY_AND_ASSIGN(SlideAnimation); 100 DISALLOW_COPY_AND_ASSIGN(SlideAnimation);
101 }; 101 };
102 102
103 #endif // APP_SLIDE_ANIMATION_H_ 103 #endif // APP_SLIDE_ANIMATION_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698