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

Unified Diff: ash/system/chromeos/network/network_icon_animation.h

Issue 12094072: Use ash NetworkIconAnimation in NetworkMenuIcon code (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 11 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 side-by-side diff with in-line comments
Download patch
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..a556e876d21ef06e697a221e996967086a828a7f
--- /dev/null
+++ b/ash/system/chromeos/network/network_icon_animation.h
@@ -0,0 +1,42 @@
+// 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"
+
+namespace ash {
+namespace network_icon {
+
+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();
+
+ double GetAnimation();
jennyz 2013/01/31 19:16:50 Please add a comment for GetAnimation method.
+
+ void AddObserver(AnimationObserver* observer);
+ void RemoveObserver(AnimationObserver* observer);
+
+ // ui::AnimationDelegate implementation.
+ virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE;
+
+ static NetworkIconAnimation* GetInstance();
+
+ private:
+ ui::ThrobAnimation animation_;
+ ObserverList<AnimationObserver> observers_;
+};
+
+} // namespace network_icon
+} // namespace ash
+
+#endif // ASH_SYSTEM_CHROMEOS_NETWORK_NETWORK_ICON_ANIMATION_H_

Powered by Google App Engine
This is Rietveld 408576698