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

Unified Diff: ui/views/animation/flood_fill_ink_drop_ripple.cc

Issue 2550933002: Make all LayerAnimationElement::Create*Element return unique_ptr (Closed)
Patch Set: Complete inclusion 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 side-by-side diff with in-line comments
Download patch
Index: ui/views/animation/flood_fill_ink_drop_ripple.cc
diff --git a/ui/views/animation/flood_fill_ink_drop_ripple.cc b/ui/views/animation/flood_fill_ink_drop_ripple.cc
index a3407c341ce61d65f71445dd650e3ade5d8a2685..10459d8c956d81588dbb6497b2631fd6b9415ffe 100644
--- a/ui/views/animation/flood_fill_ink_drop_ripple.cc
+++ b/ui/views/animation/flood_fill_ink_drop_ripple.cc
@@ -300,10 +300,12 @@ void FloodFillInkDropRipple::AnimateToTransform(
ui::ScopedLayerAnimationSettings animation(animator);
animation.SetPreemptionStrategy(preemption_strategy);
animation.SetTweenType(tween);
- ui::LayerAnimationElement* element =
+
+ std::unique_ptr<ui::LayerAnimationElement> element =
ui::LayerAnimationElement::CreateTransformElement(transform, duration);
+
ui::LayerAnimationSequence* sequence =
- new ui::LayerAnimationSequence(element);
+ new ui::LayerAnimationSequence(std::move(element));
if (animation_observer)
sequence->AddObserver(animation_observer);
@@ -325,10 +327,10 @@ void FloodFillInkDropRipple::AnimateToOpacity(
ui::ScopedLayerAnimationSettings animation_settings(animator);
animation_settings.SetPreemptionStrategy(preemption_strategy);
animation_settings.SetTweenType(tween);
- ui::LayerAnimationElement* animation_element =
+ std::unique_ptr<ui::LayerAnimationElement> animation_element =
ui::LayerAnimationElement::CreateOpacityElement(opacity, duration);
ui::LayerAnimationSequence* animation_sequence =
- new ui::LayerAnimationSequence(animation_element);
+ new ui::LayerAnimationSequence(std::move(animation_element));
if (animation_observer)
animation_sequence->AddObserver(animation_observer);

Powered by Google App Engine
This is Rietveld 408576698