Chromium Code Reviews| 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/compositor/layer_animator.h" | 5 #include "ui/compositor/layer_animator.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 | 10 |
| (...skipping 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 865 | 865 |
| 866 void LayerAnimator::GetTargetValue( | 866 void LayerAnimator::GetTargetValue( |
| 867 LayerAnimationElement::TargetValue* target) const { | 867 LayerAnimationElement::TargetValue* target) const { |
| 868 for (AnimationQueue::const_iterator iter = animation_queue_.begin(); | 868 for (AnimationQueue::const_iterator iter = animation_queue_.begin(); |
| 869 iter != animation_queue_.end(); ++iter) { | 869 iter != animation_queue_.end(); ++iter) { |
| 870 (*iter)->GetTargetValue(target); | 870 (*iter)->GetTargetValue(target); |
| 871 } | 871 } |
| 872 } | 872 } |
| 873 | 873 |
| 874 void LayerAnimator::OnScheduled(LayerAnimationSequence* sequence) { | 874 void LayerAnimator::OnScheduled(LayerAnimationSequence* sequence) { |
| 875 if (observers_.might_have_observers()) { | 875 for (auto& observer : observers_) { |
|
sky
2016/10/13 02:20:57
no {}
dcheng
2016/10/13 02:39:22
Done.
| |
| 876 base::ObserverListBase<LayerAnimationObserver>::Iterator it(&observers_); | 876 sequence->AddObserver(&observer); |
| 877 LayerAnimationObserver* obs; | |
| 878 while ((obs = it.GetNext()) != NULL) { | |
| 879 sequence->AddObserver(obs); | |
| 880 } | |
| 881 } | 877 } |
| 882 sequence->OnScheduled(); | 878 sequence->OnScheduled(); |
| 883 } | 879 } |
| 884 | 880 |
| 885 void LayerAnimator::SetTransitionDuration(base::TimeDelta duration) { | 881 void LayerAnimator::SetTransitionDuration(base::TimeDelta duration) { |
| 886 if (is_transition_duration_locked_) | 882 if (is_transition_duration_locked_) |
| 887 return; | 883 return; |
| 888 transition_duration_ = duration; | 884 transition_duration_ = duration; |
| 889 } | 885 } |
| 890 | 886 |
| (...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 934 const base::WeakPtr<LayerAnimationSequence>& sequence) | 930 const base::WeakPtr<LayerAnimationSequence>& sequence) |
| 935 : sequence_(sequence) { | 931 : sequence_(sequence) { |
| 936 } | 932 } |
| 937 | 933 |
| 938 LayerAnimator::RunningAnimation::RunningAnimation( | 934 LayerAnimator::RunningAnimation::RunningAnimation( |
| 939 const RunningAnimation& other) = default; | 935 const RunningAnimation& other) = default; |
| 940 | 936 |
| 941 LayerAnimator::RunningAnimation::~RunningAnimation() { } | 937 LayerAnimator::RunningAnimation::~RunningAnimation() { } |
| 942 | 938 |
| 943 } // namespace ui | 939 } // namespace ui |
| OLD | NEW |