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

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

Issue 2414863002: Remove usage of base::ObserverList<T>::Iter::GetNext() in //ui. (Closed)
Patch Set: debrace 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_)
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 }
882 sequence->OnScheduled(); 877 sequence->OnScheduled();
883 } 878 }
884 879
885 void LayerAnimator::SetTransitionDuration(base::TimeDelta duration) { 880 void LayerAnimator::SetTransitionDuration(base::TimeDelta duration) {
886 if (is_transition_duration_locked_) 881 if (is_transition_duration_locked_)
887 return; 882 return;
888 transition_duration_ = duration; 883 transition_duration_ = duration;
889 } 884 }
890 885
891 void LayerAnimator::ClearAnimationsInternal() { 886 void LayerAnimator::ClearAnimationsInternal() {
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
934 const base::WeakPtr<LayerAnimationSequence>& sequence) 929 const base::WeakPtr<LayerAnimationSequence>& sequence)
935 : sequence_(sequence) { 930 : sequence_(sequence) {
936 } 931 }
937 932
938 LayerAnimator::RunningAnimation::RunningAnimation( 933 LayerAnimator::RunningAnimation::RunningAnimation(
939 const RunningAnimation& other) = default; 934 const RunningAnimation& other) = default;
940 935
941 LayerAnimator::RunningAnimation::~RunningAnimation() { } 936 LayerAnimator::RunningAnimation::~RunningAnimation() { }
942 937
943 } // namespace ui 938 } // 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