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

Side by Side Diff: ash/wm/session_state_animator_impl.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: 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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/wm/session_state_animator_impl.h" 5 #include "ash/wm/session_state_animator_impl.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
251 // Starts grayscale/brightness animation for |window| over |duration|. Target 251 // Starts grayscale/brightness animation for |window| over |duration|. Target
252 // value for both grayscale and brightness are specified by |target|. 252 // value for both grayscale and brightness are specified by |target|.
253 void StartGrayscaleBrightnessAnimationForWindow( 253 void StartGrayscaleBrightnessAnimationForWindow(
254 aura::Window* window, 254 aura::Window* window,
255 float target, 255 float target,
256 base::TimeDelta duration, 256 base::TimeDelta duration,
257 gfx::Tween::Type tween_type, 257 gfx::Tween::Type tween_type,
258 ui::LayerAnimationObserver* observer) { 258 ui::LayerAnimationObserver* observer) {
259 ui::LayerAnimator* animator = window->layer()->GetAnimator(); 259 ui::LayerAnimator* animator = window->layer()->GetAnimator();
260 260
261 scoped_ptr<ui::LayerAnimationSequence> brightness_sequence( 261 std::unique_ptr<ui::LayerAnimationSequence> brightness_sequence(
262 new ui::LayerAnimationSequence()); 262 new ui::LayerAnimationSequence());
263 scoped_ptr<ui::LayerAnimationSequence> grayscale_sequence( 263 std::unique_ptr<ui::LayerAnimationSequence> grayscale_sequence(
264 new ui::LayerAnimationSequence()); 264 new ui::LayerAnimationSequence());
265 265
266 scoped_ptr<ui::LayerAnimationElement> brightness_element( 266 std::unique_ptr<ui::LayerAnimationElement> brightness_element(
267 ui::LayerAnimationElement::CreateBrightnessElement( 267 ui::LayerAnimationElement::CreateBrightnessElement(target, duration));
268 target, duration));
269 brightness_element->set_tween_type(tween_type); 268 brightness_element->set_tween_type(tween_type);
270 brightness_sequence->AddElement(brightness_element.release()); 269 brightness_sequence->AddElement(brightness_element.release());
271 270
272 scoped_ptr<ui::LayerAnimationElement> grayscale_element( 271 std::unique_ptr<ui::LayerAnimationElement> grayscale_element(
273 ui::LayerAnimationElement::CreateGrayscaleElement( 272 ui::LayerAnimationElement::CreateGrayscaleElement(target, duration));
274 target, duration));
275 grayscale_element->set_tween_type(tween_type); 273 grayscale_element->set_tween_type(tween_type);
276 grayscale_sequence->AddElement(grayscale_element.release()); 274 grayscale_sequence->AddElement(grayscale_element.release());
277 275
278 std::vector<ui::LayerAnimationSequence*> animations; 276 std::vector<ui::LayerAnimationSequence*> animations;
279 animations.push_back(brightness_sequence.release()); 277 animations.push_back(brightness_sequence.release());
280 animations.push_back(grayscale_sequence.release()); 278 animations.push_back(grayscale_sequence.release());
281 279
282 if (observer) 280 if (observer)
283 animations[0]->AddObserver(observer); 281 animations[0]->AddObserver(observer);
284 282
(...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after
663 window, 1.0, duration, gfx::Tween::EASE_IN, observer); 661 window, 1.0, duration, gfx::Tween::EASE_IN, observer);
664 break; 662 break;
665 case ANIMATION_UNDO_GRAYSCALE_BRIGHTNESS: 663 case ANIMATION_UNDO_GRAYSCALE_BRIGHTNESS:
666 StartGrayscaleBrightnessAnimationForWindow( 664 StartGrayscaleBrightnessAnimationForWindow(
667 window, 0.0, duration, gfx::Tween::EASE_IN_OUT, observer); 665 window, 0.0, duration, gfx::Tween::EASE_IN_OUT, observer);
668 break; 666 break;
669 } 667 }
670 } 668 }
671 669
672 } // namespace ash 670 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698