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

Side by Side Diff: chrome/browser/chromeos/status/network_menu_button.cc

Issue 6154001: Move animation code to new ui/base/animation directory.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/status/network_menu_button.h" 5 #include "chrome/browser/chromeos/status/network_menu_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <limits> 8 #include <limits>
9 9
10 #include "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 15 matching lines...) Expand all
26 26
27 // static 27 // static
28 const int NetworkMenuButton::kThrobDuration = 1000; 28 const int NetworkMenuButton::kThrobDuration = 1000;
29 29
30 NetworkMenuButton::NetworkMenuButton(StatusAreaHost* host) 30 NetworkMenuButton::NetworkMenuButton(StatusAreaHost* host)
31 : StatusAreaButton(this), 31 : StatusAreaButton(this),
32 NetworkMenu(), 32 NetworkMenu(),
33 host_(host), 33 host_(host),
34 ALLOW_THIS_IN_INITIALIZER_LIST(animation_connecting_(this)) { 34 ALLOW_THIS_IN_INITIALIZER_LIST(animation_connecting_(this)) {
35 animation_connecting_.SetThrobDuration(kThrobDuration); 35 animation_connecting_.SetThrobDuration(kThrobDuration);
36 animation_connecting_.SetTweenType(Tween::EASE_IN_OUT); 36 animation_connecting_.SetTweenType(ui::Tween::EASE_IN_OUT);
37 OnNetworkManagerChanged(CrosLibrary::Get()->GetNetworkLibrary()); 37 OnNetworkManagerChanged(CrosLibrary::Get()->GetNetworkLibrary());
38 CrosLibrary::Get()->GetNetworkLibrary()->AddNetworkManagerObserver(this); 38 CrosLibrary::Get()->GetNetworkLibrary()->AddNetworkManagerObserver(this);
39 CrosLibrary::Get()->GetNetworkLibrary()->AddCellularDataPlanObserver(this); 39 CrosLibrary::Get()->GetNetworkLibrary()->AddCellularDataPlanObserver(this);
40 } 40 }
41 41
42 NetworkMenuButton::~NetworkMenuButton() { 42 NetworkMenuButton::~NetworkMenuButton() {
43 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary(); 43 NetworkLibrary* netlib = CrosLibrary::Get()->GetNetworkLibrary();
44 netlib->RemoveNetworkManagerObserver(this); 44 netlib->RemoveNetworkManagerObserver(this);
45 netlib->RemoveObserverForAllNetworks(this); 45 netlib->RemoveObserverForAllNetworks(this);
46 netlib->RemoveCellularDataPlanObserver(this); 46 netlib->RemoveCellularDataPlanObserver(this);
47 } 47 }
48 48
49 //////////////////////////////////////////////////////////////////////////////// 49 ////////////////////////////////////////////////////////////////////////////////
50 // NetworkMenuButton, AnimationDelegate implementation: 50 // NetworkMenuButton, ui::AnimationDelegate implementation:
51 51
52 void NetworkMenuButton::AnimationProgressed(const Animation* animation) { 52 void NetworkMenuButton::AnimationProgressed(const ui::Animation* animation) {
53 if (animation == &animation_connecting_) { 53 if (animation == &animation_connecting_) {
54 SetIcon(IconForNetworkConnecting(animation_connecting_.GetCurrentValue(), 54 SetIcon(IconForNetworkConnecting(animation_connecting_.GetCurrentValue(),
55 false)); 55 false));
56 // No need to set the badge here, because it should already be set. 56 // No need to set the badge here, because it should already be set.
57 SchedulePaint(); 57 SchedulePaint();
58 } else { 58 } else {
59 MenuButton::AnimationProgressed(animation); 59 MenuButton::AnimationProgressed(animation);
60 } 60 }
61 } 61 }
62 62
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
195 cros->RemoveNetworkObserver(active_network_, this); 195 cros->RemoveNetworkObserver(active_network_, this);
196 } 196 }
197 if (!new_network.empty()) { 197 if (!new_network.empty()) {
198 cros->AddNetworkObserver(new_network, this); 198 cros->AddNetworkObserver(new_network, this);
199 } 199 }
200 active_network_ = new_network; 200 active_network_ = new_network;
201 } 201 }
202 } 202 }
203 203
204 } // namespace chromeos 204 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/status/network_menu_button.h ('k') | chrome/browser/chromeos/wm_overview_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698