Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 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 | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_ANIMATION_H_ | |
| 6 #define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_ANIMATION_H_ | |
| 7 | |
| 8 #include "ash/ash_export.h" | |
| 9 #include "base/observer_list.h" | |
| 10 #include "ui/base/animation/animation_delegate.h" | |
| 11 #include "ui/base/animation/throb_animation.h" | |
|
tfarina
2013/02/20 02:48:48
you could have forward declared it instead
| |
| 12 | |
| 13 namespace ash { | |
| 14 namespace network_icon { | |
|
tfarina
2013/02/20 02:48:48
why put this in this 'random' namespace?
| |
| 15 | |
| 16 class AnimationObserver; | |
| 17 | |
| 18 // Single instance class to handle icon animations and keep them in sync. | |
| 19 class ASH_EXPORT NetworkIconAnimation : public ui::AnimationDelegate { | |
| 20 public: | |
| 21 NetworkIconAnimation(); | |
| 22 virtual ~NetworkIconAnimation(); | |
| 23 | |
| 24 // Returns the current animation value, [0-1]. | |
| 25 double GetAnimation(); | |
| 26 | |
| 27 void AddObserver(AnimationObserver* observer); | |
| 28 void RemoveObserver(AnimationObserver* observer); | |
| 29 | |
| 30 // ui::AnimationDelegate implementation. | |
| 31 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | |
|
tfarina
2013/02/20 02:48:48
this could have been private
| |
| 32 | |
| 33 static NetworkIconAnimation* GetInstance(); | |
| 34 | |
| 35 private: | |
| 36 ui::ThrobAnimation animation_; | |
|
tfarina
2013/02/20 02:48:48
and used scoped_ptr<ui::ThrobAnimation> ...
| |
| 37 ObserverList<AnimationObserver> observers_; | |
| 38 }; | |
|
tfarina
2013/02/20 02:48:48
DISALLOW_COPY_AND_ASSIGN
| |
| 39 | |
| 40 } // namespace network_icon | |
| 41 } // namespace ash | |
| 42 | |
| 43 #endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_ANIMATION_H_ | |
| OLD | NEW |