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

Unified Diff: ash/wm/window_animations.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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/wm/window_animations.h ('k') | ash/wm/window_animations_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/window_animations.cc
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc
index 1ea5952a36c349ec41b5697906ff5586a6fcb4dd..a71c7c2ab3cc541ed613946121aa0eaadcf0b1be 100644
--- a/ash/wm/window_animations.cc
+++ b/ash/wm/window_animations.cc
@@ -105,11 +105,10 @@ void AddLayerAnimationsForMinimize(aura::Window* window, bool show) {
float scale_x = static_cast<float>(target_bounds.width()) / bounds.width();
float scale_y = static_cast<float>(target_bounds.height()) / bounds.height();
- scoped_ptr<ui::InterpolatedTransform> scale(
- new ui::InterpolatedScale(gfx::Point3F(1, 1, 1),
- gfx::Point3F(scale_x, scale_y, 1)));
+ std::unique_ptr<ui::InterpolatedTransform> scale(new ui::InterpolatedScale(
+ gfx::Point3F(1, 1, 1), gfx::Point3F(scale_x, scale_y, 1)));
- scoped_ptr<ui::InterpolatedTransform> translation(
+ std::unique_ptr<ui::InterpolatedTransform> translation(
new ui::InterpolatedTranslation(
gfx::PointF(), gfx::PointF(target_bounds.x() - bounds.x(),
target_bounds.y() - bounds.y())));
@@ -120,7 +119,7 @@ void AddLayerAnimationsForMinimize(aura::Window* window, bool show) {
base::TimeDelta duration = window->layer()->GetAnimator()->
GetTransitionDuration();
- scoped_ptr<ui::LayerAnimationElement> transition(
+ std::unique_ptr<ui::LayerAnimationElement> transition(
ui::LayerAnimationElement::CreateInterpolatedTransformElement(
scale.release(), duration));
@@ -269,7 +268,7 @@ class CrossFadeObserver : public ui::CompositorObserver,
// Observes |window| for destruction, but does not take ownership.
// Takes ownership of |layer| and its child layers.
CrossFadeObserver(aura::Window* window,
- scoped_ptr<ui::LayerTreeOwner> layer_owner)
+ std::unique_ptr<ui::LayerTreeOwner> layer_owner)
: window_(window), layer_owner_(std::move(layer_owner)) {
window_->AddObserver(this);
layer_owner_->root()->GetCompositor()->AddObserver(this);
@@ -307,14 +306,14 @@ class CrossFadeObserver : public ui::CompositorObserver,
private:
aura::Window* window_; // not owned
- scoped_ptr<ui::LayerTreeOwner> layer_owner_;
+ std::unique_ptr<ui::LayerTreeOwner> layer_owner_;
DISALLOW_COPY_AND_ASSIGN(CrossFadeObserver);
};
base::TimeDelta CrossFadeAnimation(
aura::Window* window,
- scoped_ptr<ui::LayerTreeOwner> old_layer_owner,
+ std::unique_ptr<ui::LayerTreeOwner> old_layer_owner,
gfx::Tween::Type tween_type) {
DCHECK(old_layer_owner->root());
const gfx::Rect old_bounds(old_layer_owner->root()->bounds());
@@ -413,20 +412,20 @@ std::vector<ui::LayerAnimationSequence*>
CreateBrightnessGrayscaleAnimationSequence(float target_value,
base::TimeDelta duration) {
gfx::Tween::Type animation_type = gfx::Tween::EASE_OUT;
- scoped_ptr<ui::LayerAnimationSequence> brightness_sequence(
+ std::unique_ptr<ui::LayerAnimationSequence> brightness_sequence(
new ui::LayerAnimationSequence());
- scoped_ptr<ui::LayerAnimationSequence> grayscale_sequence(
+ std::unique_ptr<ui::LayerAnimationSequence> grayscale_sequence(
new ui::LayerAnimationSequence());
- scoped_ptr<ui::LayerAnimationElement> brightness_element(
- ui::LayerAnimationElement::CreateBrightnessElement(
- target_value, duration));
+ std::unique_ptr<ui::LayerAnimationElement> brightness_element(
+ ui::LayerAnimationElement::CreateBrightnessElement(target_value,
+ duration));
brightness_element->set_tween_type(animation_type);
brightness_sequence->AddElement(brightness_element.release());
- scoped_ptr<ui::LayerAnimationElement> grayscale_element(
- ui::LayerAnimationElement::CreateGrayscaleElement(
- target_value, duration));
+ std::unique_ptr<ui::LayerAnimationElement> grayscale_element(
+ ui::LayerAnimationElement::CreateGrayscaleElement(target_value,
+ duration));
grayscale_element->set_tween_type(animation_type);
grayscale_sequence->AddElement(grayscale_element.release());
« no previous file with comments | « ash/wm/window_animations.h ('k') | ash/wm/window_animations_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698