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

Side by Side Diff: ash/shelf/background_animator.cc

Issue 14305026: ash: Remove use of ALLOW_THIS_IN_INITIALIZER_LIST. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 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 | Annotate | Revision Log
« no previous file with comments | « ash/launcher/launcher_button.cc ('k') | ash/shell/lock_view.cc » ('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 "ash/shelf/background_animator.h" 5 #include "ash/shelf/background_animator.h"
6 6
7 7
8 namespace ash { 8 namespace ash {
9 namespace internal { 9 namespace internal {
10 10
11 namespace { 11 namespace {
12 12
13 // Duration of the background animation. 13 // Duration of the background animation.
14 const int kBackgroundDurationMS = 1000; 14 const int kBackgroundDurationMS = 1000;
15 15
16 } 16 }
17 17
18 BackgroundAnimator::BackgroundAnimator(BackgroundAnimatorDelegate* delegate, 18 BackgroundAnimator::BackgroundAnimator(BackgroundAnimatorDelegate* delegate,
19 int min_alpha, 19 int min_alpha,
20 int max_alpha) 20 int max_alpha)
21 : delegate_(delegate), 21 : delegate_(delegate),
22 min_alpha_(min_alpha), 22 min_alpha_(min_alpha),
23 max_alpha_(max_alpha), 23 max_alpha_(max_alpha),
24 ALLOW_THIS_IN_INITIALIZER_LIST(animation_(this)), 24 animation_(this),
25 paints_background_(false), 25 paints_background_(false),
26 alpha_(min_alpha) { 26 alpha_(min_alpha) {
27 animation_.SetSlideDuration(kBackgroundDurationMS); 27 animation_.SetSlideDuration(kBackgroundDurationMS);
28 } 28 }
29 29
30 BackgroundAnimator::~BackgroundAnimator() { 30 BackgroundAnimator::~BackgroundAnimator() {
31 } 31 }
32 32
33 void BackgroundAnimator::SetDuration(int time_in_ms) { 33 void BackgroundAnimator::SetDuration(int time_in_ms) {
34 animation_.SetSlideDuration(time_in_ms); 34 animation_.SetSlideDuration(time_in_ms);
(...skipping 17 matching lines...) Expand all
52 void BackgroundAnimator::AnimationProgressed(const ui::Animation* animation) { 52 void BackgroundAnimator::AnimationProgressed(const ui::Animation* animation) {
53 int alpha = animation->CurrentValueBetween(min_alpha_, max_alpha_); 53 int alpha = animation->CurrentValueBetween(min_alpha_, max_alpha_);
54 if (alpha_ == alpha) 54 if (alpha_ == alpha)
55 return; 55 return;
56 alpha_ = alpha; 56 alpha_ = alpha;
57 delegate_->UpdateBackground(alpha_); 57 delegate_->UpdateBackground(alpha_);
58 } 58 }
59 59
60 } // namespace internal 60 } // namespace internal
61 } // namespace ash 61 } // namespace ash
OLDNEW
« no previous file with comments | « ash/launcher/launcher_button.cc ('k') | ash/shell/lock_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698