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

Unified Diff: ui/wm/core/window_animations.cc

Issue 1868363002: Replace scoped_ptr with std::unique_ptr in //ui (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@scopedptrcc
Patch Set: scopedptrui: rebase-make_scoped_ptr 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ui/wm/core/visibility_controller_unittest.cc ('k') | ui/wm/core/window_animations_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/wm/core/window_animations.cc
diff --git a/ui/wm/core/window_animations.cc b/ui/wm/core/window_animations.cc
index 80950c67ca836e517f99d0c4cf5ce31f3fd93cd6..7eb743b6d3d1e5017f8216d725ec5f226794a2e0 100644
--- a/ui/wm/core/window_animations.cc
+++ b/ui/wm/core/window_animations.cc
@@ -134,7 +134,7 @@ class HidingWindowAnimationObserverBase : public aura::WindowObserver {
aura::Window* window_;
// The owner of detached layers.
- scoped_ptr<ui::LayerTreeOwner> layer_owner_;
+ std::unique_ptr<ui::LayerTreeOwner> layer_owner_;
DISALLOW_COPY_AND_ASSIGN(HidingWindowAnimationObserverBase);
};
@@ -349,23 +349,22 @@ void AnimateHideWindow_Fade(aura::Window* window) {
ui::LayerAnimationElement* CreateGrowShrinkElement(
aura::Window* window, bool grow) {
- scoped_ptr<ui::InterpolatedTransform> scale(new ui::InterpolatedScale(
- gfx::Point3F(kWindowAnimation_Bounce_Scale,
- kWindowAnimation_Bounce_Scale,
- 1),
- gfx::Point3F(1, 1, 1)));
- scoped_ptr<ui::InterpolatedTransform> scale_about_pivot(
+ std::unique_ptr<ui::InterpolatedTransform> scale(
+ new ui::InterpolatedScale(gfx::Point3F(kWindowAnimation_Bounce_Scale,
+ kWindowAnimation_Bounce_Scale, 1),
+ gfx::Point3F(1, 1, 1)));
+ std::unique_ptr<ui::InterpolatedTransform> scale_about_pivot(
new ui::InterpolatedTransformAboutPivot(
gfx::Point(window->bounds().width() * 0.5,
window->bounds().height() * 0.5),
scale.release()));
scale_about_pivot->SetReversed(grow);
- scoped_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();
}
@@ -375,7 +374,7 @@ void AnimateBounce(aura::Window* window) {
window->layer()->GetAnimator());
scoped_settings.SetPreemptionStrategy(
ui::LayerAnimator::REPLACE_QUEUED_ANIMATIONS);
- scoped_ptr<ui::LayerAnimationSequence> sequence(
+ std::unique_ptr<ui::LayerAnimationSequence> sequence(
new ui::LayerAnimationSequence);
sequence->AddElement(CreateGrowShrinkElement(window, true));
sequence->AddElement(ui::LayerAnimationElement::CreatePauseElement(
@@ -433,7 +432,7 @@ void AddLayerAnimationsForRotate(aura::Window* window, bool show) {
duration * (100 - kWindowAnimation_Rotate_OpacityDurationPercent) / 100,
ui::LayerAnimationElement::OPACITY);
}
- scoped_ptr<ui::LayerAnimationElement> opacity(
+ std::unique_ptr<ui::LayerAnimationElement> opacity(
ui::LayerAnimationElement::CreateOpacityElement(
show ? kWindowAnimation_ShowOpacity : kWindowAnimation_HideOpacity,
duration * kWindowAnimation_Rotate_OpacityDurationPercent / 100));
@@ -447,30 +446,30 @@ void AddLayerAnimationsForRotate(aura::Window* window, bool show) {
transform.Translate(xcenter, 0);
transform.ApplyPerspectiveDepth(kWindowAnimation_Rotate_PerspectiveDepth);
transform.Translate(-xcenter, 0);
- scoped_ptr<ui::InterpolatedTransform> perspective(
+ std::unique_ptr<ui::InterpolatedTransform> perspective(
new ui::InterpolatedConstantTransform(transform));
- scoped_ptr<ui::InterpolatedTransform> scale(
+ std::unique_ptr<ui::InterpolatedTransform> scale(
new ui::InterpolatedScale(1, kWindowAnimation_Rotate_ScaleFactor));
- scoped_ptr<ui::InterpolatedTransform> scale_about_pivot(
+ std::unique_ptr<ui::InterpolatedTransform> scale_about_pivot(
new ui::InterpolatedTransformAboutPivot(
gfx::Point(xcenter, kWindowAnimation_Rotate_TranslateY),
scale.release()));
- scoped_ptr<ui::InterpolatedTransform> translation(
+ std::unique_ptr<ui::InterpolatedTransform> translation(
new ui::InterpolatedTranslation(
gfx::PointF(), gfx::PointF(0, kWindowAnimation_Rotate_TranslateY)));
- scoped_ptr<ui::InterpolatedTransform> rotation(
- new ui::InterpolatedAxisAngleRotation(
- gfx::Vector3dF(1, 0, 0), 0, kWindowAnimation_Rotate_DegreesX));
+ std::unique_ptr<ui::InterpolatedTransform> rotation(
+ new ui::InterpolatedAxisAngleRotation(gfx::Vector3dF(1, 0, 0), 0,
+ kWindowAnimation_Rotate_DegreesX));
scale_about_pivot->SetChild(perspective.release());
translation->SetChild(scale_about_pivot.release());
rotation->SetChild(translation.release());
rotation->SetReversed(show);
- scoped_ptr<ui::LayerAnimationElement> transition(
+ std::unique_ptr<ui::LayerAnimationElement> transition(
ui::LayerAnimationElement::CreateInterpolatedTransformElement(
rotation.release(), duration));
ui::LayerAnimationSequence* last_sequence =
« no previous file with comments | « ui/wm/core/visibility_controller_unittest.cc ('k') | ui/wm/core/window_animations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698