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

Unified Diff: ui/base/animation/throb_animation.cc

Issue 23531053: ui/base/animation -> ui/gfx/animation (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge 2 trunk Created 7 years, 3 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
« no previous file with comments | « ui/base/animation/throb_animation.h ('k') | ui/base/animation/tween.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/base/animation/throb_animation.cc
diff --git a/ui/base/animation/throb_animation.cc b/ui/base/animation/throb_animation.cc
deleted file mode 100644
index 72392a09161910065a63caeb933395ae86d77011..0000000000000000000000000000000000000000
--- a/ui/base/animation/throb_animation.cc
+++ /dev/null
@@ -1,85 +0,0 @@
-// Copyright (c) 2012 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 "ui/base/animation/throb_animation.h"
-
-#include <limits>
-
-namespace ui {
-
-static const int kDefaultThrobDurationMS = 400;
-
-ThrobAnimation::ThrobAnimation(AnimationDelegate* target)
- : SlideAnimation(target),
- slide_duration_(GetSlideDuration()),
- throb_duration_(kDefaultThrobDurationMS),
- cycles_remaining_(0),
- throbbing_(false) {
-}
-
-void ThrobAnimation::StartThrobbing(int cycles_til_stop) {
- cycles_til_stop = cycles_til_stop >= 0 ? cycles_til_stop :
- std::numeric_limits<int>::max();
- cycles_remaining_ = cycles_til_stop;
- throbbing_ = true;
- SlideAnimation::SetSlideDuration(throb_duration_);
- if (is_animating())
- return; // We're already running, we'll cycle when current loop finishes.
-
- if (IsShowing())
- SlideAnimation::Hide();
- else
- SlideAnimation::Show();
- cycles_remaining_ = cycles_til_stop;
-}
-
-void ThrobAnimation::Reset() {
- Reset(0);
-}
-
-void ThrobAnimation::Reset(double value) {
- ResetForSlide();
- SlideAnimation::Reset(value);
-}
-
-void ThrobAnimation::Show() {
- ResetForSlide();
- SlideAnimation::Show();
-}
-
-void ThrobAnimation::Hide() {
- ResetForSlide();
- SlideAnimation::Hide();
-}
-
-void ThrobAnimation::SetSlideDuration(int duration) {
- slide_duration_ = duration;
-}
-
-void ThrobAnimation::Step(base::TimeTicks time_now) {
- LinearAnimation::Step(time_now);
-
- if (!is_animating() && throbbing_) {
- // Were throbbing a finished a cycle. Start the next cycle unless we're at
- // the end of the cycles, in which case we stop.
- cycles_remaining_--;
- if (IsShowing()) {
- // We want to stop hidden, hence this doesn't check cycles_remaining_.
- SlideAnimation::Hide();
- } else if (cycles_remaining_ > 0) {
- SlideAnimation::Show();
- } else {
- // We're done throbbing.
- throbbing_ = false;
- }
- }
-}
-
-void ThrobAnimation::ResetForSlide() {
- SlideAnimation::SetSlideDuration(slide_duration_);
- cycles_remaining_ = 0;
- throbbing_ = false;
-}
-
-} // namespace ui
« no previous file with comments | « ui/base/animation/throb_animation.h ('k') | ui/base/animation/tween.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698