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_animation_sequence.h" | 5 #include "ui/compositor/layer_animation_sequence.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <iterator> | 8 #include <iterator> |
9 | 9 |
10 #include "base/trace_event/trace_event.h" | 10 #include "base/trace_event/trace_event.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 DCHECK(element_properties & event_property); | 221 DCHECK(element_properties & event_property); |
222 elements_[current_index]->set_effective_start_time(event.monotonic_time); | 222 elements_[current_index]->set_effective_start_time(event.monotonic_time); |
223 } | 223 } |
224 | 224 |
225 void LayerAnimationSequence::OnScheduled() { | 225 void LayerAnimationSequence::OnScheduled() { |
226 NotifyScheduled(); | 226 NotifyScheduled(); |
227 } | 227 } |
228 | 228 |
229 void LayerAnimationSequence::OnAnimatorDestroyed() { | 229 void LayerAnimationSequence::OnAnimatorDestroyed() { |
230 if (observers_.might_have_observers()) { | 230 if (observers_.might_have_observers()) { |
231 ObserverListBase<LayerAnimationObserver>::Iterator it(&observers_); | 231 base::ObserverListBase<LayerAnimationObserver>::Iterator it(&observers_); |
232 LayerAnimationObserver* obs; | 232 LayerAnimationObserver* obs; |
233 while ((obs = it.GetNext()) != NULL) { | 233 while ((obs = it.GetNext()) != NULL) { |
234 if (!obs->RequiresNotificationWhenAnimatorDestroyed()) { | 234 if (!obs->RequiresNotificationWhenAnimatorDestroyed()) { |
235 // Remove the observer, but do not allow notifications to be sent. | 235 // Remove the observer, but do not allow notifications to be sent. |
236 observers_.RemoveObserver(obs); | 236 observers_.RemoveObserver(obs); |
237 obs->DetachedFromSequence(this, false); | 237 obs->DetachedFromSequence(this, false); |
238 } | 238 } |
239 } | 239 } |
240 } | 240 } |
241 } | 241 } |
(...skipping 30 matching lines...) Expand all Loading... |
272 | 272 |
273 LayerAnimationElement* LayerAnimationSequence::CurrentElement() const { | 273 LayerAnimationElement* LayerAnimationSequence::CurrentElement() const { |
274 if (elements_.empty()) | 274 if (elements_.empty()) |
275 return NULL; | 275 return NULL; |
276 | 276 |
277 size_t current_index = last_element_ % elements_.size(); | 277 size_t current_index = last_element_ % elements_.size(); |
278 return elements_[current_index].get(); | 278 return elements_[current_index].get(); |
279 } | 279 } |
280 | 280 |
281 } // namespace ui | 281 } // namespace ui |
OLD | NEW |