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

Side by Side Diff: services/ui/ws/scheduled_animation_group.cc

Issue 2365753003: mus ws: Move 'reset(new' to base::MakeUnique. (Closed)
Patch Set: Merge with tot 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 | « services/ui/ws/platform_display.cc ('k') | services/ui/ws/server_window.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "services/ui/ws/scheduled_animation_group.h" 5 #include "services/ui/ws/scheduled_animation_group.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "services/ui/ws/server_window.h" 9 #include "services/ui/ws/server_window.h"
10 10
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 std::unique_ptr<ScheduledAnimationValue> value; 197 std::unique_ptr<ScheduledAnimationValue> value;
198 for (const ScheduledAnimationSequence& sequence : sequences) { 198 for (const ScheduledAnimationSequence& sequence : sequences) {
199 base::TimeDelta duration; 199 base::TimeDelta duration;
200 for (const ScheduledAnimationElement& element : sequence.elements) { 200 for (const ScheduledAnimationElement& element : sequence.elements) {
201 if (element.property != property) 201 if (element.property != property)
202 continue; 202 continue;
203 203
204 duration += element.duration; 204 duration += element.duration;
205 if (duration > max_end_duration) { 205 if (duration > max_end_duration) {
206 max_end_duration = duration; 206 max_end_duration = duration;
207 value.reset(new ScheduledAnimationValue(element.target_value)); 207 value = base::MakeUnique<ScheduledAnimationValue>(element.target_value);
208 } 208 }
209 } 209 }
210 } 210 }
211 if (value.get()) 211 if (value.get())
212 SetWindowPropertyFromValue(window, property, *value); 212 SetWindowPropertyFromValue(window, property, *value);
213 } 213 }
214 214
215 void ConvertSequenceToScheduled( 215 void ConvertSequenceToScheduled(
216 const mojom::AnimationSequence& transport_sequence, 216 const mojom::AnimationSequence& transport_sequence,
217 base::TimeTicks now, 217 base::TimeTicks now,
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
348 return sequences_.empty(); 348 return sequences_.empty();
349 } 349 }
350 350
351 ScheduledAnimationGroup::ScheduledAnimationGroup(ServerWindow* window, 351 ScheduledAnimationGroup::ScheduledAnimationGroup(ServerWindow* window,
352 uint32_t id, 352 uint32_t id,
353 base::TimeTicks time_scheduled) 353 base::TimeTicks time_scheduled)
354 : window_(window), id_(id), time_scheduled_(time_scheduled) {} 354 : window_(window), id_(id), time_scheduled_(time_scheduled) {}
355 355
356 } // namespace ws 356 } // namespace ws
357 } // namespace ui 357 } // namespace ui
OLDNEW
« no previous file with comments | « services/ui/ws/platform_display.cc ('k') | services/ui/ws/server_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698