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

Unified Diff: ash/common/system/chromeos/network/network_icon_animation.cc

Issue 2734653002: chromeos: Move files in //ash/common to //ash (Closed)
Patch Set: fix a11y tests, fix docs Created 3 years, 10 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/common/system/chromeos/network/network_icon_animation.cc
diff --git a/ash/common/system/chromeos/network/network_icon_animation.cc b/ash/common/system/chromeos/network/network_icon_animation.cc
deleted file mode 100644
index 26e67512394a50af84e832d0cec8e8a0003459e5..0000000000000000000000000000000000000000
--- a/ash/common/system/chromeos/network/network_icon_animation.cc
+++ /dev/null
@@ -1,59 +0,0 @@
-// 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.
-
-#include "ash/common/system/chromeos/network/network_icon_animation.h"
-
-#include "ash/common/system/chromeos/network/network_icon_animation_observer.h"
-
-namespace {
-const int kThrobDurationMs = 750; // Animation cycle length.
-}
-
-namespace ash {
-namespace network_icon {
-
-NetworkIconAnimation::NetworkIconAnimation() : animation_(this) {
- // Set up the animation throbber.
- animation_.SetThrobDuration(kThrobDurationMs);
- animation_.SetTweenType(gfx::Tween::LINEAR);
-}
-
-NetworkIconAnimation::~NetworkIconAnimation() {}
-
-void NetworkIconAnimation::AnimationProgressed(
- const gfx::Animation* animation) {
- if (animation != &animation_)
- return;
- for (AnimationObserver& observer : observers_)
- observer.NetworkIconChanged();
-}
-
-double NetworkIconAnimation::GetAnimation() {
- if (!animation_.is_animating()) {
- animation_.Reset();
- animation_.StartThrobbing(-1 /*throb indefinitely*/);
- return 0;
- }
- return animation_.GetCurrentValue();
-}
-
-void NetworkIconAnimation::AddObserver(AnimationObserver* observer) {
- if (!observers_.HasObserver(observer))
- observers_.AddObserver(observer);
-}
-
-void NetworkIconAnimation::RemoveObserver(AnimationObserver* observer) {
- observers_.RemoveObserver(observer);
- if (!observers_.might_have_observers())
- animation_.Reset(); // Stops the animation and resets the current value.
-}
-
-// static
-NetworkIconAnimation* NetworkIconAnimation::GetInstance() {
- static NetworkIconAnimation* s_icon_animation = new NetworkIconAnimation();
- return s_icon_animation;
-}
-
-} // namespace network_icon
-} // namespace ash

Powered by Google App Engine
This is Rietveld 408576698