| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/system/chromeos/network/network_icon_animation.h" | 5 #include "ash/system/chromeos/network/network_icon_animation.h" |
| 6 | 6 |
| 7 #include "ash/system/chromeos/network/network_icon_animation_observer.h" | 7 #include "ash/system/chromeos/network/network_icon_animation_observer.h" |
| 8 | 8 |
| 9 namespace { | 9 namespace { |
| 10 const int kThrobDurationMs = 750; // Animation cycle length. | 10 const int kThrobDurationMs = 750; // Animation cycle length. |
| 11 } | 11 } |
| 12 | 12 |
| 13 namespace ash { | 13 namespace ash { |
| 14 namespace network_icon { | 14 namespace network_icon { |
| 15 | 15 |
| 16 NetworkIconAnimation::NetworkIconAnimation() | 16 NetworkIconAnimation::NetworkIconAnimation() |
| 17 : ALLOW_THIS_IN_INITIALIZER_LIST(animation_(this)) { | 17 : animation_(this) { |
| 18 // Set up the animation throbber. | 18 // Set up the animation throbber. |
| 19 animation_.SetThrobDuration(kThrobDurationMs); | 19 animation_.SetThrobDuration(kThrobDurationMs); |
| 20 animation_.SetTweenType(ui::Tween::LINEAR); | 20 animation_.SetTweenType(ui::Tween::LINEAR); |
| 21 } | 21 } |
| 22 | 22 |
| 23 NetworkIconAnimation::~NetworkIconAnimation() { | 23 NetworkIconAnimation::~NetworkIconAnimation() { |
| 24 } | 24 } |
| 25 | 25 |
| 26 void NetworkIconAnimation::AnimationProgressed(const ui::Animation* animation) { | 26 void NetworkIconAnimation::AnimationProgressed(const ui::Animation* animation) { |
| 27 if (animation != &animation_) | 27 if (animation != &animation_) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 51 | 51 |
| 52 // static | 52 // static |
| 53 NetworkIconAnimation* NetworkIconAnimation::GetInstance() { | 53 NetworkIconAnimation* NetworkIconAnimation::GetInstance() { |
| 54 static NetworkIconAnimation* s_icon_animation = | 54 static NetworkIconAnimation* s_icon_animation = |
| 55 new NetworkIconAnimation(); | 55 new NetworkIconAnimation(); |
| 56 return s_icon_animation; | 56 return s_icon_animation; |
| 57 } | 57 } |
| 58 | 58 |
| 59 } // namespace network_icon | 59 } // namespace network_icon |
| 60 } // namespace ash | 60 } // namespace ash |
| OLD | NEW |