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

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

Issue 2550933002: Make all LayerAnimationElement::Create*Element return unique_ptr (Closed)
Patch Set: Created 4 years 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
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 #ifndef UI_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ 5 #ifndef UI_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_
6 #define UI_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ 6 #define UI_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <vector> 10 #include <vector>
11 11
12 #include "base/gtest_prod_util.h" 12 #include "base/gtest_prod_util.h"
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/memory/linked_ptr.h"
15 #include "base/memory/weak_ptr.h" 14 #include "base/memory/weak_ptr.h"
16 #include "base/observer_list.h" 15 #include "base/observer_list.h"
17 #include "base/time/time.h" 16 #include "base/time/time.h"
18 #include "ui/compositor/compositor_export.h" 17 #include "ui/compositor/compositor_export.h"
19 #include "ui/compositor/layer_animation_element.h" 18 #include "ui/compositor/layer_animation_element.h"
20 19
21 namespace ui { 20 namespace ui {
22 21
23 class LayerAnimationDelegate; 22 class LayerAnimationDelegate;
24 class LayerAnimationObserver; 23 class LayerAnimationObserver;
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
130 // by this sequence. Returns 0.0 if no elements have been progressed. 129 // by this sequence. Returns 0.0 if no elements have been progressed.
131 double last_progressed_fraction() const { return last_progressed_fraction_; } 130 double last_progressed_fraction() const { return last_progressed_fraction_; }
132 131
133 size_t size() const; 132 size_t size() const;
134 133
135 LayerAnimationElement* FirstElement() const; 134 LayerAnimationElement* FirstElement() const;
136 135
137 private: 136 private:
138 friend class LayerAnimatorTestController; 137 friend class LayerAnimatorTestController;
139 138
140 typedef std::vector<linked_ptr<LayerAnimationElement> > Elements; 139 using Elements = std::vector<std::unique_ptr<LayerAnimationElement>>;
141 140
142 FRIEND_TEST_ALL_PREFIXES(LayerAnimatorTest, 141 FRIEND_TEST_ALL_PREFIXES(LayerAnimatorTest,
143 ObserverReleasedBeforeAnimationSequenceEnds); 142 ObserverReleasedBeforeAnimationSequenceEnds);
144 143
145 // Notifies the observers that this sequence has been scheduled. 144 // Notifies the observers that this sequence has been scheduled.
146 void NotifyScheduled(); 145 void NotifyScheduled();
147 146
148 // Notifies the observers that this sequence has been started. 147 // Notifies the observers that this sequence has been started.
149 void NotifyStarted(); 148 void NotifyStarted();
150 149
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 double last_progressed_fraction_; 190 double last_progressed_fraction_;
192 191
193 base::WeakPtrFactory<LayerAnimationSequence> weak_ptr_factory_; 192 base::WeakPtrFactory<LayerAnimationSequence> weak_ptr_factory_;
194 193
195 DISALLOW_COPY_AND_ASSIGN(LayerAnimationSequence); 194 DISALLOW_COPY_AND_ASSIGN(LayerAnimationSequence);
196 }; 195 };
197 196
198 } // namespace ui 197 } // namespace ui
199 198
200 #endif // UI_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_ 199 #endif // UI_COMPOSITOR_LAYER_ANIMATION_SEQUENCE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698