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

Unified Diff: ui/views/animation/square_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/square_ink_drop_ripple.cc
diff --git a/ui/views/animation/square_ink_drop_ripple.cc b/ui/views/animation/square_ink_drop_ripple.cc
index ffa339e3f815beab4c1e24418b6972a00ae508f7..64def3348ec3f48bb8847b8f74bba7ef6088d172 100644
--- a/ui/views/animation/square_ink_drop_ripple.cc
+++ b/ui/views/animation/square_ink_drop_ripple.cc
@@ -451,10 +451,10 @@ void SquareInkDropRipple::AnimateCenterPoint(
animation.SetTweenType(tween);
gfx::Transform transform;
transform.Translate(target_center_point_.x(), target_center_point_.y());
- 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 (observer)
sequence->AddObserver(observer);
@@ -473,11 +473,11 @@ void SquareInkDropRipple::AnimateToTransforms(
ui::ScopedLayerAnimationSettings animation(animator);
animation.SetPreemptionStrategy(preemption_strategy);
animation.SetTweenType(tween);
- ui::LayerAnimationElement* element =
+ std::unique_ptr<ui::LayerAnimationElement> element =
ui::LayerAnimationElement::CreateTransformElement(transforms[i],
duration);
ui::LayerAnimationSequence* sequence =
- new ui::LayerAnimationSequence(element);
+ new ui::LayerAnimationSequence(std::move(element));
if (animation_observer)
sequence->AddObserver(animation_observer);
@@ -505,10 +505,10 @@ void SquareInkDropRipple::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