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

Unified Diff: ash/launcher/background_animator.cc

Issue 12313118: Refactor: Shelf Widget (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: safer shutdown (status_area_widget_) Created 7 years, 9 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 | « ash/launcher/background_animator.h ('k') | ash/launcher/launcher.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/launcher/background_animator.cc
diff --git a/ash/launcher/background_animator.cc b/ash/launcher/background_animator.cc
deleted file mode 100644
index db1d8aa463b1e750b8be52e6adfa315b4211de04..0000000000000000000000000000000000000000
--- a/ash/launcher/background_animator.cc
+++ /dev/null
@@ -1,57 +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 "ash/launcher/background_animator.h"
-
-
-namespace ash {
-namespace internal {
-
-namespace {
-
-// Duration of the background animation.
-const int kBackgroundDurationMS = 1000;
-
-}
-
-BackgroundAnimator::BackgroundAnimator(BackgroundAnimatorDelegate* delegate,
- int min_alpha,
- int max_alpha)
- : delegate_(delegate),
- min_alpha_(min_alpha),
- max_alpha_(max_alpha),
- ALLOW_THIS_IN_INITIALIZER_LIST(animation_(this)),
- paints_background_(false),
- alpha_(min_alpha) {
- animation_.SetSlideDuration(kBackgroundDurationMS);
-}
-
-BackgroundAnimator::~BackgroundAnimator() {
-}
-
-void BackgroundAnimator::SetPaintsBackground(bool value, ChangeType type) {
- if (paints_background_ == value)
- return;
- paints_background_ = value;
- if (type == CHANGE_IMMEDIATE && !animation_.is_animating()) {
- animation_.Reset(value ? 1.0f : 0.0f);
- AnimationProgressed(&animation_);
- return;
- }
- if (paints_background_)
- animation_.Show();
- else
- animation_.Hide();
-}
-
-void BackgroundAnimator::AnimationProgressed(const ui::Animation* animation) {
- int alpha = animation->CurrentValueBetween(min_alpha_, max_alpha_);
- if (alpha_ == alpha)
- return;
- alpha_ = alpha;
- delegate_->UpdateBackground(alpha_);
-}
-
-} // namespace internal
-} // namespace ash
« no previous file with comments | « ash/launcher/background_animator.h ('k') | ash/launcher/launcher.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698