| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/views/animation/bounds_animator.h" | 5 #include "ui/views/animation/bounds_animator.h" |
| 6 | 6 |
| 7 #include <memory> | 7 #include <memory> |
| 8 | 8 |
| 9 #include "ui/gfx/animation/animation_container.h" | 9 #include "ui/gfx/animation/animation_container.h" |
| 10 #include "ui/gfx/animation/slide_animation.h" | 10 #include "ui/gfx/animation/slide_animation.h" |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 void BoundsAnimator::AnimationContainerProgressed( | 257 void BoundsAnimator::AnimationContainerProgressed( |
| 258 AnimationContainer* container) { | 258 AnimationContainer* container) { |
| 259 if (!repaint_bounds_.IsEmpty()) { | 259 if (!repaint_bounds_.IsEmpty()) { |
| 260 // Adjust for rtl. | 260 // Adjust for rtl. |
| 261 repaint_bounds_.set_x(parent_->GetMirroredXWithWidthInView( | 261 repaint_bounds_.set_x(parent_->GetMirroredXWithWidthInView( |
| 262 repaint_bounds_.x(), repaint_bounds_.width())); | 262 repaint_bounds_.x(), repaint_bounds_.width())); |
| 263 parent_->SchedulePaintInRect(repaint_bounds_); | 263 parent_->SchedulePaintInRect(repaint_bounds_); |
| 264 repaint_bounds_.SetRect(0, 0, 0, 0); | 264 repaint_bounds_.SetRect(0, 0, 0, 0); |
| 265 } | 265 } |
| 266 | 266 |
| 267 FOR_EACH_OBSERVER(BoundsAnimatorObserver, | 267 for (BoundsAnimatorObserver& observer : observers_) |
| 268 observers_, | 268 observer.OnBoundsAnimatorProgressed(this); |
| 269 OnBoundsAnimatorProgressed(this)); | |
| 270 | 269 |
| 271 if (!IsAnimating()) { | 270 if (!IsAnimating()) { |
| 272 // Notify here rather than from AnimationXXX to avoid deleting the animation | 271 // Notify here rather than from AnimationXXX to avoid deleting the animation |
| 273 // while the animation is calling us. | 272 // while the animation is calling us. |
| 274 FOR_EACH_OBSERVER(BoundsAnimatorObserver, | 273 for (BoundsAnimatorObserver& observer : observers_) |
| 275 observers_, | 274 observer.OnBoundsAnimatorDone(this); |
| 276 OnBoundsAnimatorDone(this)); | |
| 277 } | 275 } |
| 278 } | 276 } |
| 279 | 277 |
| 280 void BoundsAnimator::AnimationContainerEmpty(AnimationContainer* container) { | 278 void BoundsAnimator::AnimationContainerEmpty(AnimationContainer* container) { |
| 281 } | 279 } |
| 282 | 280 |
| 283 } // namespace views | 281 } // namespace views |
| OLD | NEW |