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

Side by Side Diff: ui/app_list/views/pulsing_block_view.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 unified diff | Download patch
« no previous file with comments | « ui/app_list/views/progress_bar_view.h ('k') | ui/app_list/views/search_box_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "ui/app_list/views/pulsing_block_view.h" 5 #include "ui/app_list/views/pulsing_block_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 13 matching lines...) Expand all
24 const int kBlockSize = 64; 24 const int kBlockSize = 64;
25 25
26 const int kAnimationDurationInMs = 600; 26 const int kAnimationDurationInMs = 600;
27 const float kAnimationOpacity[] = { 0.4f, 0.8f, 0.4f }; 27 const float kAnimationOpacity[] = { 0.4f, 0.8f, 0.4f };
28 const float kAnimationScale[] = { 0.8f, 1.0f, 0.8f }; 28 const float kAnimationScale[] = { 0.8f, 1.0f, 0.8f };
29 29
30 void SchedulePulsingAnimation(ui::Layer* layer) { 30 void SchedulePulsingAnimation(ui::Layer* layer) {
31 DCHECK(layer); 31 DCHECK(layer);
32 DCHECK_EQ(arraysize(kAnimationOpacity), arraysize(kAnimationScale)); 32 DCHECK_EQ(arraysize(kAnimationOpacity), arraysize(kAnimationScale));
33 33
34 scoped_ptr<ui::LayerAnimationSequence> opacity_sequence( 34 std::unique_ptr<ui::LayerAnimationSequence> opacity_sequence(
35 new ui::LayerAnimationSequence()); 35 new ui::LayerAnimationSequence());
36 scoped_ptr<ui::LayerAnimationSequence> transform_sequence( 36 std::unique_ptr<ui::LayerAnimationSequence> transform_sequence(
37 new ui::LayerAnimationSequence()); 37 new ui::LayerAnimationSequence());
38 38
39 // The animations loop infinitely. 39 // The animations loop infinitely.
40 opacity_sequence->set_is_cyclic(true); 40 opacity_sequence->set_is_cyclic(true);
41 transform_sequence->set_is_cyclic(true); 41 transform_sequence->set_is_cyclic(true);
42 42
43 const gfx::Rect local_bounds(layer->bounds().size()); 43 const gfx::Rect local_bounds(layer->bounds().size());
44 for (size_t i = 0; i < arraysize(kAnimationOpacity); ++i) { 44 for (size_t i = 0; i < arraysize(kAnimationOpacity); ++i) {
45 opacity_sequence->AddElement( 45 opacity_sequence->AddElement(
46 ui::LayerAnimationElement::CreateOpacityElement( 46 ui::LayerAnimationElement::CreateOpacityElement(
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after
92 SchedulePulsingAnimation(layer()); 92 SchedulePulsingAnimation(layer());
93 } 93 }
94 94
95 void PulsingBlockView::OnPaint(gfx::Canvas* canvas) { 95 void PulsingBlockView::OnPaint(gfx::Canvas* canvas) {
96 gfx::Rect rect(GetContentsBounds()); 96 gfx::Rect rect(GetContentsBounds());
97 rect.ClampToCenteredSize(gfx::Size(kBlockSize, kBlockSize)); 97 rect.ClampToCenteredSize(gfx::Size(kBlockSize, kBlockSize));
98 canvas->FillRect(rect, kBlockColor); 98 canvas->FillRect(rect, kBlockColor);
99 } 99 }
100 100
101 } // namespace app_list 101 } // namespace app_list
OLDNEW
« no previous file with comments | « ui/app_list/views/progress_bar_view.h ('k') | ui/app_list/views/search_box_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698