OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 VIEWS_ANIMATION_BOUNDS_ANIMATOR_H_ | 5 #ifndef VIEWS_ANIMATION_BOUNDS_ANIMATOR_H_ |
6 #define VIEWS_ANIMATION_BOUNDS_ANIMATOR_H_ | 6 #define VIEWS_ANIMATION_BOUNDS_ANIMATOR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 | 10 |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 void SetTargetBounds(View* view, const gfx::Rect& target); | 64 void SetTargetBounds(View* view, const gfx::Rect& target); |
65 | 65 |
66 // Sets the animation for the specified view. BoundsAnimator takes ownership | 66 // Sets the animation for the specified view. BoundsAnimator takes ownership |
67 // of the specified animation. | 67 // of the specified animation. |
68 void SetAnimationForView(View* view, ui::SlideAnimation* animation); | 68 void SetAnimationForView(View* view, ui::SlideAnimation* animation); |
69 | 69 |
70 // Returns the animation for the specified view. BoundsAnimator owns the | 70 // Returns the animation for the specified view. BoundsAnimator owns the |
71 // returned Animation. | 71 // returned Animation. |
72 const ui::SlideAnimation* GetAnimationForView(View* view); | 72 const ui::SlideAnimation* GetAnimationForView(View* view); |
73 | 73 |
74 // Stops animating the specified view. If the view was scheduled for deletion | 74 // Stops animating the specified view. |
75 // it is deleted. This does nothing if |view| is not currently animating. | |
76 void StopAnimatingView(View* view); | 75 void StopAnimatingView(View* view); |
77 | 76 |
78 // Sets the delegate for the animation created for the specified view. If | 77 // Sets the delegate for the animation created for the specified view. If |
79 // |delete_when_done| is true the |delegate| is deleted when done and | 78 // |delete_when_done| is true the |delegate| is deleted when done and |
80 // |delegate| must subclass OwnedAnimationDelegate. | 79 // |delegate| must subclass OwnedAnimationDelegate. |
81 void SetAnimationDelegate(View* view, | 80 void SetAnimationDelegate(View* view, |
82 ui::AnimationDelegate* delegate, | 81 ui::AnimationDelegate* delegate, |
83 bool delete_when_done); | 82 bool delete_when_done); |
84 | 83 |
85 // Returns true if BoundsAnimator is animating the bounds of |view|. | 84 // Returns true if BoundsAnimator is animating the bounds of |view|. |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
164 View* parent_; | 163 View* parent_; |
165 | 164 |
166 BoundsAnimatorObserver* observer_; | 165 BoundsAnimatorObserver* observer_; |
167 | 166 |
168 // All animations we create up with the same container. | 167 // All animations we create up with the same container. |
169 scoped_refptr<ui::AnimationContainer> container_; | 168 scoped_refptr<ui::AnimationContainer> container_; |
170 | 169 |
171 // Maps from view being animated to info about the view. | 170 // Maps from view being animated to info about the view. |
172 ViewToDataMap data_; | 171 ViewToDataMap data_; |
173 | 172 |
174 // Makes from animation to view. | 173 // Maps from animation to view. |
175 AnimationToViewMap animation_to_view_; | 174 AnimationToViewMap animation_to_view_; |
176 | 175 |
177 // As the animations we created update (AnimationProgressed is invoked) this | 176 // As the animations we create update (AnimationProgressed is invoked) this |
178 // is updated. When all the animations have completed for a given tick of | 177 // is updated. When all the animations have completed for a given tick of |
179 // the timer (AnimationContainerProgressed is invoked) the parent_ is asked | 178 // the timer (AnimationContainerProgressed is invoked) the parent_ is asked |
180 // to repaint these bounds. | 179 // to repaint these bounds. |
181 gfx::Rect repaint_bounds_; | 180 gfx::Rect repaint_bounds_; |
182 | 181 |
183 DISALLOW_COPY_AND_ASSIGN(BoundsAnimator); | 182 DISALLOW_COPY_AND_ASSIGN(BoundsAnimator); |
184 }; | 183 }; |
185 | 184 |
186 } // namespace views | 185 } // namespace views |
187 | 186 |
188 #endif // VIEWS_ANIMATION_BOUNDS_ANIMATOR_H_ | 187 #endif // VIEWS_ANIMATION_BOUNDS_ANIMATOR_H_ |
OLD | NEW |