| OLD | NEW |
| 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/launcher/launcher_button.h" | 5 #include "ash/launcher/launcher_button.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "ash/launcher/launcher_button_host.h" | 9 #include "ash/launcher/launcher_button_host.h" |
| 10 #include "ash/shelf/shelf_layout_manager.h" | 10 #include "ash/shelf/shelf_layout_manager.h" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 int GetAlpha() { | 72 int GetAlpha() { |
| 73 return GetThrobAnimation().CurrentValueBetween(0, 255); | 73 return GetThrobAnimation().CurrentValueBetween(0, 255); |
| 74 } | 74 } |
| 75 | 75 |
| 76 double GetAnimation() { | 76 double GetAnimation() { |
| 77 return GetThrobAnimation().GetCurrentValue(); | 77 return GetThrobAnimation().GetCurrentValue(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 private: | 80 private: |
| 81 LauncherButtonAnimation() | 81 LauncherButtonAnimation() |
| 82 : ALLOW_THIS_IN_INITIALIZER_LIST(animation_(this)) { | 82 : animation_(this) { |
| 83 animation_.SetThrobDuration(kAttentionThrobDurationMS); | 83 animation_.SetThrobDuration(kAttentionThrobDurationMS); |
| 84 animation_.SetTweenType(ui::Tween::SMOOTH_IN_OUT); | 84 animation_.SetTweenType(ui::Tween::SMOOTH_IN_OUT); |
| 85 } | 85 } |
| 86 | 86 |
| 87 virtual ~LauncherButtonAnimation() { | 87 virtual ~LauncherButtonAnimation() { |
| 88 } | 88 } |
| 89 | 89 |
| 90 ui::ThrobAnimation& GetThrobAnimation() { | 90 ui::ThrobAnimation& GetThrobAnimation() { |
| 91 if (!animation_.is_animating()) { | 91 if (!animation_.is_animating()) { |
| 92 animation_.Reset(); | 92 animation_.Reset(); |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 views::ImageView::TRAILING, | 520 views::ImageView::TRAILING, |
| 521 views::ImageView::CENTER, | 521 views::ImageView::CENTER, |
| 522 views::ImageView::CENTER, | 522 views::ImageView::CENTER, |
| 523 views::ImageView::LEADING)); | 523 views::ImageView::LEADING)); |
| 524 bar_->SchedulePaint(); | 524 bar_->SchedulePaint(); |
| 525 SchedulePaint(); | 525 SchedulePaint(); |
| 526 } | 526 } |
| 527 | 527 |
| 528 } // namespace internal | 528 } // namespace internal |
| 529 } // namespace ash | 529 } // namespace ash |
| OLD | NEW |