OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ |
6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "app/throb_animation.h" | 9 #include "app/throb_animation.h" |
10 #include "base/timer.h" | 10 #include "base/timer.h" |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 virtual ~NetworkMenuButton(); | 52 virtual ~NetworkMenuButton(); |
53 | 53 |
54 // AnimationDelegate implementation. | 54 // AnimationDelegate implementation. |
55 virtual void AnimationProgressed(const Animation* animation); | 55 virtual void AnimationProgressed(const Animation* animation); |
56 | 56 |
57 // NetworkLibrary::Observer implementation. | 57 // NetworkLibrary::Observer implementation. |
58 virtual void NetworkChanged(NetworkLibrary* obj); | 58 virtual void NetworkChanged(NetworkLibrary* obj); |
59 virtual void CellularDataPlanChanged(NetworkLibrary* obj); | 59 virtual void CellularDataPlanChanged(NetworkLibrary* obj); |
60 | 60 |
61 // Sets the badge icon. | 61 // Sets the badge icon. |
62 void SetBadge(const SkBitmap& badge); | 62 void SetBadge(const SkBitmap& badge) { badge_ = badge; } |
63 SkBitmap badge() const { return badge_; } | 63 SkBitmap badge() const { return badge_; } |
64 | 64 |
65 protected: | 65 protected: |
66 // StatusAreaButton implementation. | 66 // StatusAreaButton implementation. |
67 virtual void DrawPressed(gfx::Canvas* canvas); | |
68 virtual void DrawIcon(gfx::Canvas* canvas); | 67 virtual void DrawIcon(gfx::Canvas* canvas); |
69 | 68 |
70 // NetworkMenu implementation: | 69 // NetworkMenu implementation: |
71 virtual bool IsBrowserMode() const; | 70 virtual bool IsBrowserMode() const; |
72 virtual gfx::NativeWindow GetNativeWindow() const; | 71 virtual gfx::NativeWindow GetNativeWindow() const; |
73 virtual void OpenButtonOptions() const; | 72 virtual void OpenButtonOptions() const; |
74 virtual bool ShouldOpenButtonOptions() const; | 73 virtual bool ShouldOpenButtonOptions() const; |
75 | 74 |
76 private: | 75 private: |
77 // The status area host, | 76 // The status area host, |
78 StatusAreaHost* host_; | 77 StatusAreaHost* host_; |
79 | 78 |
80 // A badge icon displayed on top of the icon. | 79 // A badge icon displayed on top of the icon. |
81 SkBitmap badge_; | 80 SkBitmap badge_; |
82 | 81 |
83 // The throb animation that does the wifi connecting animation. | 82 // The throb animation that does the wifi connecting animation. |
84 ThrobAnimation animation_connecting_; | 83 ThrobAnimation animation_connecting_; |
85 | 84 |
86 // The duration of the icon throbbing in milliseconds. | 85 // The duration of the icon throbbing in milliseconds. |
87 static const int kThrobDuration; | 86 static const int kThrobDuration; |
88 | 87 |
89 DISALLOW_COPY_AND_ASSIGN(NetworkMenuButton); | 88 DISALLOW_COPY_AND_ASSIGN(NetworkMenuButton); |
90 }; | 89 }; |
91 | 90 |
92 } // namespace chromeos | 91 } // namespace chromeos |
93 | 92 |
94 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ | 93 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ |
OLD | NEW |