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

Unified Diff: ash/wm/window_animations.cc

Issue 2550933002: Make all LayerAnimationElement::Create*Element return unique_ptr (Closed)
Patch Set: 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/wm/window_animations.cc
diff --git a/ash/wm/window_animations.cc b/ash/wm/window_animations.cc
index d10dca36819c4e45983b351395f0f5194a2f339f..c12e164c01a62db5596425226984e287cc572c0b 100644
--- a/ash/wm/window_animations.cc
+++ b/ash/wm/window_animations.cc
@@ -387,26 +387,25 @@ std::vector<ui::LayerAnimationSequence*>
CreateBrightnessGrayscaleAnimationSequence(float target_value,
base::TimeDelta duration) {
gfx::Tween::Type animation_type = gfx::Tween::EASE_OUT;
- std::unique_ptr<ui::LayerAnimationSequence> brightness_sequence(
- new ui::LayerAnimationSequence());
- std::unique_ptr<ui::LayerAnimationSequence> grayscale_sequence(
- new ui::LayerAnimationSequence());
+ ui::LayerAnimationSequence* brightness_sequence =
+ new ui::LayerAnimationSequence();
+ ui::LayerAnimationSequence* grayscale_sequence =
+ new ui::LayerAnimationSequence();
- std::unique_ptr<ui::LayerAnimationElement> brightness_element(
+ ui::LayerAnimationElement* brightness_element =
ui::LayerAnimationElement::CreateBrightnessElement(target_value,
- duration));
+ duration);
brightness_element->set_tween_type(animation_type);
- brightness_sequence->AddElement(brightness_element.release());
+ brightness_sequence->AddElement(brightness_element);
- std::unique_ptr<ui::LayerAnimationElement> grayscale_element(
- ui::LayerAnimationElement::CreateGrayscaleElement(target_value,
- duration));
+ ui::LayerAnimationElement* grayscale_element =
+ ui::LayerAnimationElement::CreateGrayscaleElement(target_value, duration);
grayscale_element->set_tween_type(animation_type);
- grayscale_sequence->AddElement(grayscale_element.release());
+ grayscale_sequence->AddElement(grayscale_element);
std::vector<ui::LayerAnimationSequence*> animations;
- animations.push_back(brightness_sequence.release());
- animations.push_back(grayscale_sequence.release());
+ animations.push_back(brightness_sequence);
+ animations.push_back(grayscale_sequence);
return animations;
}

Powered by Google App Engine
This is Rietveld 408576698