summaryrefslogtreecommitdiffstats
path: root/chrome/browser/chromeos/status
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 03:43:55 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-05 03:43:55 +0000
commit4ce7e15da651c6221720e33dc8c500830d4b6b8a (patch)
tree376ef1d7e7951dae3376e65f4edee9e7367adc89 /chrome/browser/chromeos/status
parent5ee3ca64cdf2d00f82a1bc36f36e8ab5e520b4de (diff)
downloadchromium_src-4ce7e15da651c6221720e33dc8c500830d4b6b8a.zip
chromium_src-4ce7e15da651c6221720e33dc8c500830d4b6b8a.tar.gz
chromium_src-4ce7e15da651c6221720e33dc8c500830d4b6b8a.tar.bz2
Refactors animation to allow for cleaner subclassing. I'm doing this
for creating a different animation subclass (which you'll see shortly). BUG=none TEST=none Review URL: http://codereview.chromium.org/1961001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@46433 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/chromeos/status')
-rw-r--r--chrome/browser/chromeos/status/network_menu_button.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/chrome/browser/chromeos/status/network_menu_button.cc b/chrome/browser/chromeos/status/network_menu_button.cc
index 8cb7eba..dea19d8 100644
--- a/chrome/browser/chromeos/status/network_menu_button.cc
+++ b/chrome/browser/chromeos/status/network_menu_button.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -34,7 +34,7 @@ NetworkMenuButton::NetworkMenuButton(StatusAreaHost* host)
ALLOW_THIS_IN_INITIALIZER_LIST(network_menu_(this)),
ALLOW_THIS_IN_INITIALIZER_LIST(animation_connecting_(this)) {
animation_connecting_.SetThrobDuration(kThrobDuration);
- animation_connecting_.SetTweenType(SlideAnimation::NONE);
+ animation_connecting_.SetTweenType(Tween::LINEAR);
NetworkChanged(CrosLibrary::Get()->GetNetworkLibrary());
CrosLibrary::Get()->GetNetworkLibrary()->AddObserver(this);
}
@@ -185,7 +185,7 @@ void NetworkMenuButton::DrawPressed(gfx::Canvas* canvas) {
// If ethernet connected and not current connecting, then show ethernet
// pressed icon. Otherwise, show the bars pressed icon.
if (CrosLibrary::Get()->GetNetworkLibrary()->ethernet_connected() &&
- !animation_connecting_.IsAnimating())
+ !animation_connecting_.is_animating())
canvas->DrawBitmapInt(IconForDisplay(
*ResourceBundle::GetSharedInstance().
GetBitmapNamed(IDR_STATUSBAR_NETWORK_WIRED_PRESSED), SkBitmap()),
@@ -230,19 +230,19 @@ void NetworkMenuButton::DrawIcon(gfx::Canvas* canvas) {
// figure out if we are to also draw the extra image.
int downloading_index = -1;
int uploading_index = -1;
- if (!animation_connecting_.IsAnimating()) {
+ if (!animation_connecting_.is_animating()) {
// For network animation, we only show animation in one direction.
// So when we are hiding, we just use 1 minus the value.
// We have kNumWifiImages + 1 number of states. For the first state, where
// we are not adding any images, we set the index to -1.
- if (animation_downloading_.IsAnimating()) {
+ if (animation_downloading_.is_animating()) {
double value_downloading = animation_downloading_.IsShowing() ?
animation_downloading_.GetCurrentValue() :
1.0 - animation_downloading_.GetCurrentValue();
downloading_index = static_cast<int>(value_downloading *
nextafter(static_cast<float>(kNumWifiImages + 1), 0)) - 1;
}
- if (animation_uploading_.IsAnimating()) {
+ if (animation_uploading_.is_animating()) {
double value_uploading = animation_uploading_.IsShowing() ?
animation_uploading_.GetCurrentValue() :
1.0 - animation_uploading_.GetCurrentValue();
@@ -299,7 +299,7 @@ void NetworkMenuButton::NetworkChanged(NetworkLibrary* cros) {
if (CrosLibrary::Get()->EnsureLoaded()) {
if (cros->wifi_connecting() || cros->cellular_connecting()) {
// Start the connecting animation if not running.
- if (!animation_connecting_.IsAnimating()) {
+ if (!animation_connecting_.is_animating()) {
animation_connecting_.Reset();
animation_connecting_.StartThrobbing(std::numeric_limits<int>::max());
SetIcon(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS1));