Chromium Code Reviews| Index: ash/system/chromeos/network/network_icon_animation.h |
| diff --git a/ash/system/chromeos/network/network_icon_animation.h b/ash/system/chromeos/network/network_icon_animation.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..9a1dfc3894ac8d3b7357228e328bf066e87a0d51 |
| --- /dev/null |
| +++ b/ash/system/chromeos/network/network_icon_animation.h |
| @@ -0,0 +1,43 @@ |
| +// Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_ANIMATION_H_ |
| +#define ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_ANIMATION_H_ |
| + |
| +#include "ash/ash_export.h" |
| +#include "base/observer_list.h" |
| +#include "ui/base/animation/animation_delegate.h" |
| +#include "ui/base/animation/throb_animation.h" |
|
tfarina
2013/02/20 02:48:48
you could have forward declared it instead
|
| + |
| +namespace ash { |
| +namespace network_icon { |
|
tfarina
2013/02/20 02:48:48
why put this in this 'random' namespace?
|
| + |
| +class AnimationObserver; |
| + |
| +// Single instance class to handle icon animations and keep them in sync. |
| +class ASH_EXPORT NetworkIconAnimation : public ui::AnimationDelegate { |
| + public: |
| + NetworkIconAnimation(); |
| + virtual ~NetworkIconAnimation(); |
| + |
| + // Returns the current animation value, [0-1]. |
| + double GetAnimation(); |
| + |
| + void AddObserver(AnimationObserver* observer); |
| + void RemoveObserver(AnimationObserver* observer); |
| + |
| + // ui::AnimationDelegate implementation. |
| + virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
|
tfarina
2013/02/20 02:48:48
this could have been private
|
| + |
| + static NetworkIconAnimation* GetInstance(); |
| + |
| + private: |
| + ui::ThrobAnimation animation_; |
|
tfarina
2013/02/20 02:48:48
and used scoped_ptr<ui::ThrobAnimation> ...
|
| + ObserverList<AnimationObserver> observers_; |
| +}; |
|
tfarina
2013/02/20 02:48:48
DISALLOW_COPY_AND_ASSIGN
|
| + |
| +} // namespace network_icon |
| +} // namespace ash |
| + |
| +#endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_ANIMATION_H_ |