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 26 matching lines...) Expand all Loading... |
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 virtual ~NetworkMenuIcon(); | 45 virtual ~NetworkMenuIcon(); |
46 | 46 |
| 47 // Setter for |last_network_type_| |
| 48 void set_last_network_type(ConnectionType last_network_type) { |
| 49 last_network_type_ = last_network_type; |
| 50 } |
| 51 |
47 // Generates and returns the icon bitmap. This will never return NULL. | 52 // Generates and returns the icon bitmap. This will never return NULL. |
48 // Also sets |text| if not NULL. Behavior varies depending on |mode_|. | 53 // Also sets |text| if not NULL. Behavior varies depending on |mode_|. |
49 const SkBitmap GetIconAndText(string16* text); | 54 const SkBitmap GetIconAndText(string16* text); |
50 | 55 |
51 // ui::AnimationDelegate implementation. | 56 // ui::AnimationDelegate implementation. |
52 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; | 57 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
53 | 58 |
54 // Static functions for generating network icon bitmaps: | 59 // Static functions for generating network icon bitmaps: |
55 | 60 |
56 // Composites the bitmaps to generate a network icon. | 61 // Composites the bitmaps to generate a network icon. |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 ConnectionType last_network_type_; | 105 ConnectionType last_network_type_; |
101 scoped_ptr<NetworkIcon> icon_; | 106 scoped_ptr<NetworkIcon> icon_; |
102 const Network* connecting_network_; // weak pointer. | 107 const Network* connecting_network_; // weak pointer. |
103 | 108 |
104 DISALLOW_COPY_AND_ASSIGN(NetworkMenuIcon); | 109 DISALLOW_COPY_AND_ASSIGN(NetworkMenuIcon); |
105 }; | 110 }; |
106 | 111 |
107 } // namespace chromeos | 112 } // namespace chromeos |
108 | 113 |
109 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_ICON_H_ | 114 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_ICON_H_ |
OLD | NEW |