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

Unified Diff: ash/rotator/screen_rotation_animation.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: ash/rotator/screen_rotation_animation.cc
diff --git a/ash/rotator/screen_rotation_animation.cc b/ash/rotator/screen_rotation_animation.cc
index 4e65e543181a9f6dd790be6da5ef46a933d9c11c..9e73b861c84a53035c800a5f99b2be231fe4faf1 100644
--- a/ash/rotator/screen_rotation_animation.cc
+++ b/ash/rotator/screen_rotation_animation.cc
@@ -4,6 +4,7 @@
#include "ash/rotator/screen_rotation_animation.h"
+#include "base/memory/ptr_util.h"
#include "base/time/time.h"
#include "ui/compositor/layer.h"
#include "ui/compositor/layer_animation_delegate.h"
@@ -28,15 +29,16 @@ ScreenRotationAnimation::ScreenRotationAnimation(ui::Layer* layer,
tween_type_(tween_type),
initial_opacity_(initial_opacity),
target_opacity_(target_opacity) {
- std::unique_ptr<ui::InterpolatedTransform> rotation(
- new ui::InterpolatedTransformAboutPivot(
- pivot, new ui::InterpolatedRotation(start_degrees, end_degrees)));
+ std::unique_ptr<ui::InterpolatedTransform> rotation =
+ base::MakeUnique<ui::InterpolatedTransformAboutPivot>(
+ pivot, base::MakeUnique<ui::InterpolatedRotation>(start_degrees,
+ end_degrees));
// Use the target transform/bounds in case the layer is already animating.
gfx::Transform current_transform = layer->GetTargetTransform();
interpolated_transform_.reset(
new ui::InterpolatedConstantTransform(current_transform));
- interpolated_transform_->SetChild(rotation.release());
+ interpolated_transform_->SetChild(std::move(rotation));
}
ScreenRotationAnimation::~ScreenRotationAnimation() {}

Powered by Google App Engine
This is Rietveld 408576698