Index: ui/wm/core/window_animations.cc |
diff --git a/ui/wm/core/window_animations.cc b/ui/wm/core/window_animations.cc |
index c32da2952fd77c9e4761381eb64b9cce11f6baf7..432c054d35fc82937415d409b838e2d64645bd10 100644 |
--- a/ui/wm/core/window_animations.cc |
+++ b/ui/wm/core/window_animations.cc |
@@ -351,8 +351,9 @@ void AnimateHideWindow_Fade(aura::Window* window) { |
AnimateHideWindowCommon(window, gfx::Transform()); |
} |
-ui::LayerAnimationElement* CreateGrowShrinkElement( |
- aura::Window* window, bool grow) { |
+std::unique_ptr<ui::LayerAnimationElement> CreateGrowShrinkElement( |
+ aura::Window* window, |
+ bool grow) { |
std::unique_ptr<ui::InterpolatedTransform> scale( |
new ui::InterpolatedScale(gfx::Point3F(kWindowAnimation_Bounce_Scale, |
kWindowAnimation_Bounce_Scale, 1), |
@@ -363,14 +364,14 @@ ui::LayerAnimationElement* CreateGrowShrinkElement( |
window->bounds().height() * 0.5), |
scale.release())); |
scale_about_pivot->SetReversed(grow); |
- std::unique_ptr<ui::LayerAnimationElement> transition( |
+ std::unique_ptr<ui::LayerAnimationElement> transition = |
ui::LayerAnimationElement::CreateInterpolatedTransformElement( |
scale_about_pivot.release(), |
base::TimeDelta::FromMilliseconds( |
kWindowAnimation_Bounce_DurationMS * |
- kWindowAnimation_Bounce_GrowShrinkDurationPercent / 100))); |
+ kWindowAnimation_Bounce_GrowShrinkDurationPercent / 100)); |
transition->set_tween_type(grow ? gfx::Tween::EASE_OUT : gfx::Tween::EASE_IN); |
- return transition.release(); |
+ return transition; |
} |
void AnimateBounce(aura::Window* window) { |
@@ -436,10 +437,10 @@ void AddLayerAnimationsForRotate(aura::Window* window, bool show) { |
duration * (100 - kWindowAnimation_Rotate_OpacityDurationPercent) / 100, |
ui::LayerAnimationElement::OPACITY); |
} |
- std::unique_ptr<ui::LayerAnimationElement> opacity( |
+ std::unique_ptr<ui::LayerAnimationElement> opacity = |
ui::LayerAnimationElement::CreateOpacityElement( |
show ? kWindowAnimation_ShowOpacity : kWindowAnimation_HideOpacity, |
- duration * kWindowAnimation_Rotate_OpacityDurationPercent / 100)); |
+ duration * kWindowAnimation_Rotate_OpacityDurationPercent / 100); |
opacity->set_tween_type(gfx::Tween::EASE_IN_OUT); |
window->layer()->GetAnimator()->ScheduleAnimation( |
new ui::LayerAnimationSequence(opacity.release())); |
@@ -473,11 +474,11 @@ void AddLayerAnimationsForRotate(aura::Window* window, bool show) { |
rotation->SetChild(translation.release()); |
rotation->SetReversed(show); |
- std::unique_ptr<ui::LayerAnimationElement> transition( |
+ std::unique_ptr<ui::LayerAnimationElement> transition = |
ui::LayerAnimationElement::CreateInterpolatedTransformElement( |
- rotation.release(), duration)); |
+ rotation.release(), duration); |
loyso (OOO)
2016/12/08 00:05:21
std::move ?
|
ui::LayerAnimationSequence* last_sequence = |
- new ui::LayerAnimationSequence(transition.release()); |
+ new ui::LayerAnimationSequence(std::move(transition)); |
window->layer()->GetAnimator()->ScheduleAnimation(last_sequence); |
if (observer) { |