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

Side by Side Diff: ash/rotator/screen_rotation_animation.cc

Issue 1867223004: Convert //ash from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: address comments Created 4 years, 8 months 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ash/rotator/screen_rotation_animation.h" 5 #include "ash/rotator/screen_rotation_animation.h"
6 6
7 #include "base/time/time.h" 7 #include "base/time/time.h"
8 #include "ui/compositor/layer.h" 8 #include "ui/compositor/layer.h"
9 #include "ui/compositor/layer_animation_delegate.h" 9 #include "ui/compositor/layer_animation_delegate.h"
10 #include "ui/gfx/animation/tween.h" 10 #include "ui/gfx/animation/tween.h"
(...skipping 11 matching lines...) Expand all
22 float target_opacity, 22 float target_opacity,
23 gfx::Point pivot, 23 gfx::Point pivot,
24 base::TimeDelta duration, 24 base::TimeDelta duration,
25 gfx::Tween::Type tween_type) 25 gfx::Tween::Type tween_type)
26 : ui::LayerAnimationElement( 26 : ui::LayerAnimationElement(
27 LayerAnimationElement::TRANSFORM | LayerAnimationElement::OPACITY, 27 LayerAnimationElement::TRANSFORM | LayerAnimationElement::OPACITY,
28 duration), 28 duration),
29 tween_type_(tween_type), 29 tween_type_(tween_type),
30 initial_opacity_(initial_opacity), 30 initial_opacity_(initial_opacity),
31 target_opacity_(target_opacity) { 31 target_opacity_(target_opacity) {
32 scoped_ptr<ui::InterpolatedTransform> rotation( 32 std::unique_ptr<ui::InterpolatedTransform> rotation(
33 new ui::InterpolatedTransformAboutPivot( 33 new ui::InterpolatedTransformAboutPivot(
34 pivot, new ui::InterpolatedRotation(start_degrees, end_degrees))); 34 pivot, new ui::InterpolatedRotation(start_degrees, end_degrees)));
35 35
36 // Use the target transform/bounds in case the layer is already animating. 36 // Use the target transform/bounds in case the layer is already animating.
37 gfx::Transform current_transform = layer->GetTargetTransform(); 37 gfx::Transform current_transform = layer->GetTargetTransform();
38 interpolated_transform_.reset( 38 interpolated_transform_.reset(
39 new ui::InterpolatedConstantTransform(current_transform)); 39 new ui::InterpolatedConstantTransform(current_transform));
40 interpolated_transform_->SetChild(rotation.release()); 40 interpolated_transform_->SetChild(rotation.release());
41 } 41 }
42 42
(...skipping 17 matching lines...) Expand all
60 target->transform = interpolated_transform_->Interpolate(1.0); 60 target->transform = interpolated_transform_->Interpolate(1.0);
61 } 61 }
62 62
63 void ScreenRotationAnimation::OnAbort(ui::LayerAnimationDelegate* delegate) { 63 void ScreenRotationAnimation::OnAbort(ui::LayerAnimationDelegate* delegate) {
64 TargetValue target_value; 64 TargetValue target_value;
65 OnGetTarget(&target_value); 65 OnGetTarget(&target_value);
66 delegate->SetTransformFromAnimation(target_value.transform); 66 delegate->SetTransformFromAnimation(target_value.transform);
67 } 67 }
68 68
69 } // namespace ash 69 } // namespace ash
OLDNEW
« no previous file with comments | « ash/rotator/screen_rotation_animation.h ('k') | ash/rotator/screen_rotation_animation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698