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

Side by Side Diff: views/animation/bounds_animator.cc

Issue 1961001: Refactors animation to allow for cleaner subclassing. I'm doing this (Closed)
Patch Set: Incorporated review feedback Created 10 years, 7 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
« no previous file with comments | « chrome/browser/views/tabs/tab_strip.cc ('k') | views/controls/button/custom_button.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include "views/animation/bounds_animator.h" 5 #include "views/animation/bounds_animator.h"
6 6
7 #include "app/slide_animation.h" 7 #include "app/slide_animation.h"
8 #include "base/scoped_ptr.h" 8 #include "base/scoped_ptr.h"
9 #include "views/view.h" 9 #include "views/view.h"
10 10
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
119 data_.begin()->second.animation->Stop(); 119 data_.begin()->second.animation->Stop();
120 120
121 // Invoke AnimationContainerProgressed to force a repaint and notify delegate. 121 // Invoke AnimationContainerProgressed to force a repaint and notify delegate.
122 AnimationContainerProgressed(container_.get()); 122 AnimationContainerProgressed(container_.get());
123 } 123 }
124 124
125 SlideAnimation* BoundsAnimator::CreateAnimation() { 125 SlideAnimation* BoundsAnimator::CreateAnimation() {
126 SlideAnimation* animation = new SlideAnimation(this); 126 SlideAnimation* animation = new SlideAnimation(this);
127 animation->SetContainer(container_.get()); 127 animation->SetContainer(container_.get());
128 animation->SetSlideDuration(kAnimationDuration); 128 animation->SetSlideDuration(kAnimationDuration);
129 animation->SetTweenType(SlideAnimation::EASE_OUT); 129 animation->SetTweenType(Tween::EASE_OUT);
130 return animation; 130 return animation;
131 } 131 }
132 132
133 void BoundsAnimator::RemoveFromMaps(View* view) { 133 void BoundsAnimator::RemoveFromMaps(View* view) {
134 DCHECK(data_.count(view) > 0); 134 DCHECK(data_.count(view) > 0);
135 DCHECK(animation_to_view_.count(data_[view].animation) > 0); 135 DCHECK(animation_to_view_.count(data_[view].animation) > 0);
136 136
137 animation_to_view_.erase(data_[view].animation); 137 animation_to_view_.erase(data_[view].animation);
138 data_.erase(view); 138 data_.erase(view);
139 } 139 }
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // Notify here rather than from AnimationXXX to avoid deleting the animation 238 // Notify here rather than from AnimationXXX to avoid deleting the animation
239 // while the animaion is calling us. 239 // while the animaion is calling us.
240 observer_->OnBoundsAnimatorDone(this); 240 observer_->OnBoundsAnimatorDone(this);
241 } 241 }
242 } 242 }
243 243
244 void BoundsAnimator::AnimationContainerEmpty(AnimationContainer* container) { 244 void BoundsAnimator::AnimationContainerEmpty(AnimationContainer* container) {
245 } 245 }
246 246
247 } // namespace views 247 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/views/tabs/tab_strip.cc ('k') | views/controls/button/custom_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698