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

Side by Side Diff: ui/compositor/layer_animator.cc

Issue 2414863002: Remove usage of base::ObserverList<T>::Iter::GetNext() in //ui. (Closed)
Patch Set: de-auto Created 4 years, 2 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 | « ui/compositor/layer_animation_sequence.cc ('k') | ui/events/platform/platform_event_source.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) 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
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 (LayerAnimationObserver& observer : observers_) {
sky 2016/10/13 17:02:19 no {}
dcheng 2016/10/13 17:25:59 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
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
OLDNEW
« no previous file with comments | « ui/compositor/layer_animation_sequence.cc ('k') | ui/events/platform/platform_event_source.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698