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 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 explicit NetworkMenuButton(gfx::NativeWindow parent_window); | 60 explicit NetworkMenuButton(gfx::NativeWindow parent_window); |
61 virtual ~NetworkMenuButton(); | 61 virtual ~NetworkMenuButton(); |
62 | 62 |
63 // menus::MenuModel implementation. | 63 // menus::MenuModel implementation. |
64 virtual bool HasIcons() const { return true; } | 64 virtual bool HasIcons() const { return true; } |
65 virtual int GetItemCount() const; | 65 virtual int GetItemCount() const; |
66 virtual menus::MenuModel::ItemType GetTypeAt(int index) const; | 66 virtual menus::MenuModel::ItemType GetTypeAt(int index) const; |
67 virtual int GetCommandIdAt(int index) const { return index; } | 67 virtual int GetCommandIdAt(int index) const { return index; } |
68 virtual string16 GetLabelAt(int index) const; | 68 virtual string16 GetLabelAt(int index) const; |
69 virtual bool IsLabelDynamicAt(int index) const { return true; } | 69 virtual bool IsLabelDynamicAt(int index) const { return true; } |
| 70 virtual const gfx::Font* GetLabelFontAt(int index) const; |
70 virtual bool GetAcceleratorAt(int index, | 71 virtual bool GetAcceleratorAt(int index, |
71 menus::Accelerator* accelerator) const { return false; } | 72 menus::Accelerator* accelerator) const { return false; } |
72 virtual bool IsItemCheckedAt(int index) const; | 73 virtual bool IsItemCheckedAt(int index) const; |
73 virtual int GetGroupIdAt(int index) const { return 0; } | 74 virtual int GetGroupIdAt(int index) const { return 0; } |
74 virtual bool GetIconAt(int index, SkBitmap* icon) const; | 75 virtual bool GetIconAt(int index, SkBitmap* icon) const; |
75 virtual bool IsEnabledAt(int index) const; | 76 virtual bool IsEnabledAt(int index) const; |
76 virtual menus::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } | 77 virtual menus::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } |
77 virtual void HighlightChangedTo(int index) {} | 78 virtual void HighlightChangedTo(int index) {} |
78 virtual void ActivatedAt(int index); | 79 virtual void ActivatedAt(int index); |
79 virtual void MenuWillShow() {} | 80 virtual void MenuWillShow() {} |
(...skipping 14 matching lines...) Expand all Loading... |
94 // StatusAreaButton implementation. | 95 // StatusAreaButton implementation. |
95 virtual void DrawIcon(gfx::Canvas* canvas); | 96 virtual void DrawIcon(gfx::Canvas* canvas); |
96 | 97 |
97 private: | 98 private: |
98 enum MenuItemFlags { | 99 enum MenuItemFlags { |
99 FLAG_DISABLED = 1 << 0, | 100 FLAG_DISABLED = 1 << 0, |
100 FLAG_TOGGLE_ETHERNET = 1 << 1, | 101 FLAG_TOGGLE_ETHERNET = 1 << 1, |
101 FLAG_TOGGLE_WIFI = 1 << 2, | 102 FLAG_TOGGLE_WIFI = 1 << 2, |
102 FLAG_TOGGLE_CELLULAR = 1 << 3, | 103 FLAG_TOGGLE_CELLULAR = 1 << 3, |
103 FLAG_TOGGLE_OFFLINE = 1 << 4, | 104 FLAG_TOGGLE_OFFLINE = 1 << 4, |
104 FLAG_ACTIVATE_WIFI = 1 << 5, | 105 FLAG_BOLD = 1 << 5, |
105 FLAG_ACTIVATE_CELLULAR = 1 << 6 | 106 FLAG_ETHERNET = 1 << 6, |
| 107 FLAG_WIFI = 1 << 7, |
| 108 FLAG_CELLULAR = 1 << 8, |
106 }; | 109 }; |
107 | 110 |
108 struct MenuItem { | 111 struct MenuItem { |
109 MenuItem() | 112 MenuItem() |
110 : type(menus::MenuModel::TYPE_SEPARATOR), | 113 : type(menus::MenuModel::TYPE_SEPARATOR), |
111 flags(0) {} | 114 flags(0) {} |
112 MenuItem(menus::MenuModel::ItemType type, string16 label, SkBitmap icon, | 115 MenuItem(menus::MenuModel::ItemType type, string16 label, SkBitmap icon, |
113 WifiNetwork wifi_network, CellularNetwork cellular_network, | 116 WifiNetwork wifi_network, CellularNetwork cellular_network, |
114 int flags) | 117 int flags) |
115 : type(type), | 118 : type(type), |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 | 165 |
163 // The duration of the icon throbbing in milliseconds. | 166 // The duration of the icon throbbing in milliseconds. |
164 static const int kThrobDuration; | 167 static const int kThrobDuration; |
165 | 168 |
166 DISALLOW_COPY_AND_ASSIGN(NetworkMenuButton); | 169 DISALLOW_COPY_AND_ASSIGN(NetworkMenuButton); |
167 }; | 170 }; |
168 | 171 |
169 } // namespace chromeos | 172 } // namespace chromeos |
170 | 173 |
171 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ | 174 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_BUTTON_H_ |
OLD | NEW |