OLD | NEW |
---|---|
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_ICON_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_ICON_H_ |
6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_ICON_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_ICON_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <map> | 10 #include <map> |
(...skipping 23 matching lines...) Expand all Loading... | |
34 BARS | 34 BARS |
35 }; | 35 }; |
36 | 36 |
37 class Delegate { | 37 class Delegate { |
38 public: | 38 public: |
39 // Called when the bitmap has changed due to animation. Callback should | 39 // Called when the bitmap has changed due to animation. Callback should |
40 // trigger a call to GetIconAndText() to generate and retrieve the bitmap. | 40 // trigger a call to GetIconAndText() to generate and retrieve the bitmap. |
41 virtual void NetworkMenuIconChanged() = 0; | 41 virtual void NetworkMenuIconChanged() = 0; |
42 }; | 42 }; |
43 | 43 |
44 NetworkMenuIcon(Delegate* delegate, Mode mode); | 44 NetworkMenuIcon(Delegate* delegate, Mode mode, |
45 ConnectionType last_network_type); | |
stevenjb
2011/11/28 19:35:45
This is non-intuitive in the constructor; my first
altimofeev
2011/11/29 17:10:46
Done.
| |
45 virtual ~NetworkMenuIcon(); | 46 virtual ~NetworkMenuIcon(); |
46 | 47 |
47 // Generates and returns the icon bitmap. This will never return NULL. | 48 // Generates and returns the icon bitmap. This will never return NULL. |
48 // Also sets |text| if not NULL. Behavior varies depending on |mode_|. | 49 // Also sets |text| if not NULL. Behavior varies depending on |mode_|. |
49 const SkBitmap GetIconAndText(string16* text); | 50 const SkBitmap GetIconAndText(string16* text); |
50 | 51 |
51 // ui::AnimationDelegate implementation. | 52 // ui::AnimationDelegate implementation. |
52 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 53 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
53 | 54 |
54 // Static functions for generating network icon bitmaps: | 55 // Static functions for generating network icon bitmaps: |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
100 ConnectionType last_network_type_; | 101 ConnectionType last_network_type_; |
101 scoped_ptr<NetworkIcon> icon_; | 102 scoped_ptr<NetworkIcon> icon_; |
102 const Network* connecting_network_; // weak pointer. | 103 const Network* connecting_network_; // weak pointer. |
103 | 104 |
104 DISALLOW_COPY_AND_ASSIGN(NetworkMenuIcon); | 105 DISALLOW_COPY_AND_ASSIGN(NetworkMenuIcon); |
105 }; | 106 }; |
106 | 107 |
107 } // namespace chromeos | 108 } // namespace chromeos |
108 | 109 |
109 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_ICON_H_ | 110 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_ICON_H_ |
OLD | NEW |