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

Unified Diff: ui/views/animation/ink_drop_highlight.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/ink_drop_highlight.cc
diff --git a/ui/views/animation/ink_drop_highlight.cc b/ui/views/animation/ink_drop_highlight.cc
index 12202a26fce3e38eaa938559723ce283cba299f8..33f2adf0e8ee7c76fb60396b759082641a72778e 100644
--- a/ui/views/animation/ink_drop_highlight.cc
+++ b/ui/views/animation/ink_drop_highlight.cc
@@ -113,21 +113,23 @@ void InkDropHighlight::AnimateFade(AnimationType animation_type,
animation.SetPreemptionStrategy(
ui::LayerAnimator::IMMEDIATELY_ANIMATE_TO_NEW_TARGET);
- ui::LayerAnimationElement* opacity_element =
+ std::unique_ptr<ui::LayerAnimationElement> opacity_element =
ui::LayerAnimationElement::CreateOpacityElement(
animation_type == FADE_IN ? visible_opacity_ : kHiddenOpacity,
duration);
ui::LayerAnimationSequence* opacity_sequence =
- new ui::LayerAnimationSequence(opacity_element);
+ new ui::LayerAnimationSequence(std::move(opacity_element));
opacity_sequence->AddObserver(animation_observer);
animator->StartAnimation(opacity_sequence);
if (initial_size != target_size) {
- ui::LayerAnimationElement* transform_element =
+ std::unique_ptr<ui::LayerAnimationElement> transform_element =
ui::LayerAnimationElement::CreateTransformElement(
CalculateTransform(target_size), duration);
+
ui::LayerAnimationSequence* transform_sequence =
- new ui::LayerAnimationSequence(transform_element);
+ new ui::LayerAnimationSequence(std::move(transform_element));
+
transform_sequence->AddObserver(animation_observer);
animator->StartAnimation(transform_sequence);
}

Powered by Google App Engine
This is Rietveld 408576698