OLD | NEW |
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 "base/scoped_ptr.h" | 7 #include "base/scoped_ptr.h" |
8 #include "ui/base/animation/animation_container.h" | 8 #include "ui/base/animation/animation_container.h" |
9 #include "ui/base/animation/slide_animation.h" | 9 #include "ui/base/animation/slide_animation.h" |
10 #include "views/view.h" | 10 #include "views/view.h" |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 void BoundsAnimator::AnimationContainerProgressed( | 233 void BoundsAnimator::AnimationContainerProgressed( |
234 AnimationContainer* container) { | 234 AnimationContainer* container) { |
235 if (!repaint_bounds_.IsEmpty()) { | 235 if (!repaint_bounds_.IsEmpty()) { |
236 // Adjust for rtl. | 236 // Adjust for rtl. |
237 repaint_bounds_.set_x(parent_->GetMirroredXWithWidthInView( | 237 repaint_bounds_.set_x(parent_->GetMirroredXWithWidthInView( |
238 repaint_bounds_.x(), repaint_bounds_.width())); | 238 repaint_bounds_.x(), repaint_bounds_.width())); |
239 parent_->SchedulePaint(repaint_bounds_, false); | 239 parent_->SchedulePaint(repaint_bounds_, false); |
240 repaint_bounds_.SetRect(0, 0, 0, 0); | 240 repaint_bounds_.SetRect(0, 0, 0, 0); |
241 } | 241 } |
242 | 242 |
243 if (observer_ && !IsAnimating()) { | 243 if (observer_) { |
244 // Notify here rather than from AnimationXXX to avoid deleting the animation | 244 if (IsAnimating()) { |
245 // while the animaion is calling us. | 245 observer_->OnBoundsAnimatorProgressed(this); |
246 observer_->OnBoundsAnimatorDone(this); | 246 } else { |
| 247 // Notify here rather than from AnimationXXX to avoid deleting |
| 248 // the animation while the animaion is calling us. |
| 249 observer_->OnBoundsAnimatorDone(this); |
| 250 } |
247 } | 251 } |
248 } | 252 } |
249 | 253 |
250 void BoundsAnimator::AnimationContainerEmpty(AnimationContainer* container) { | 254 void BoundsAnimator::AnimationContainerEmpty(AnimationContainer* container) { |
251 } | 255 } |
252 | 256 |
253 } // namespace views | 257 } // namespace views |
OLD | NEW |