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

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

Issue 2417613003: Remove usage of FOR_EACH_OBSERVER macro in ui/compositor/. (Closed)
Patch Set: Add missing entries. 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.cc ('k') | ui/compositor/test/in_process_context_factory.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_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 20 matching lines...) Expand all
31 is_cyclic_(false), 31 is_cyclic_(false),
32 last_element_(0), 32 last_element_(0),
33 waiting_for_group_start_(false), 33 waiting_for_group_start_(false),
34 animation_group_id_(0), 34 animation_group_id_(0),
35 last_progressed_fraction_(0.0), 35 last_progressed_fraction_(0.0),
36 weak_ptr_factory_(this) { 36 weak_ptr_factory_(this) {
37 AddElement(element); 37 AddElement(element);
38 } 38 }
39 39
40 LayerAnimationSequence::~LayerAnimationSequence() { 40 LayerAnimationSequence::~LayerAnimationSequence() {
41 FOR_EACH_OBSERVER(LayerAnimationObserver, 41 for (auto& observer : observers_)
42 observers_, 42 observer.DetachedFromSequence(this, true);
43 DetachedFromSequence(this, true));
44 } 43 }
45 44
46 void LayerAnimationSequence::Start(LayerAnimationDelegate* delegate) { 45 void LayerAnimationSequence::Start(LayerAnimationDelegate* delegate) {
47 DCHECK(start_time_ != base::TimeTicks()); 46 DCHECK(start_time_ != base::TimeTicks());
48 last_progressed_fraction_ = 0.0; 47 last_progressed_fraction_ = 0.0;
49 if (elements_.empty()) 48 if (elements_.empty())
50 return; 49 return;
51 50
52 NotifyStarted(); 51 NotifyStarted();
53 52
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 250
252 LayerAnimationElement* LayerAnimationSequence::FirstElement() const { 251 LayerAnimationElement* LayerAnimationSequence::FirstElement() const {
253 if (elements_.empty()) { 252 if (elements_.empty()) {
254 return NULL; 253 return NULL;
255 } 254 }
256 255
257 return elements_[0].get(); 256 return elements_[0].get();
258 } 257 }
259 258
260 void LayerAnimationSequence::NotifyScheduled() { 259 void LayerAnimationSequence::NotifyScheduled() {
261 FOR_EACH_OBSERVER(LayerAnimationObserver, 260 for (auto& observer : observers_)
262 observers_, 261 observer.OnLayerAnimationScheduled(this);
263 OnLayerAnimationScheduled(this));
264 } 262 }
265 263
266 void LayerAnimationSequence::NotifyStarted() { 264 void LayerAnimationSequence::NotifyStarted() {
267 FOR_EACH_OBSERVER(LayerAnimationObserver, observers_, 265 for (auto& observer : observers_)
268 OnLayerAnimationStarted(this)); 266 observer.OnLayerAnimationStarted(this);
269 } 267 }
270 268
271 void LayerAnimationSequence::NotifyEnded() { 269 void LayerAnimationSequence::NotifyEnded() {
272 FOR_EACH_OBSERVER(LayerAnimationObserver, 270 for (auto& observer : observers_)
273 observers_, 271 observer.OnLayerAnimationEnded(this);
274 OnLayerAnimationEnded(this));
275 } 272 }
276 273
277 void LayerAnimationSequence::NotifyAborted() { 274 void LayerAnimationSequence::NotifyAborted() {
278 FOR_EACH_OBSERVER(LayerAnimationObserver, 275 for (auto& observer : observers_)
279 observers_, 276 observer.OnLayerAnimationAborted(this);
280 OnLayerAnimationAborted(this));
281 } 277 }
282 278
283 LayerAnimationElement* LayerAnimationSequence::CurrentElement() const { 279 LayerAnimationElement* LayerAnimationSequence::CurrentElement() const {
284 if (elements_.empty()) 280 if (elements_.empty())
285 return NULL; 281 return NULL;
286 282
287 size_t current_index = last_element_ % elements_.size(); 283 size_t current_index = last_element_ % elements_.size();
288 return elements_[current_index].get(); 284 return elements_[current_index].get();
289 } 285 }
290 286
291 } // namespace ui 287 } // namespace ui
OLDNEW
« no previous file with comments | « ui/compositor/layer.cc ('k') | ui/compositor/test/in_process_context_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698