| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ | 6 #define CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 void SetFirstLevelMenuWidth(int width); | 107 void SetFirstLevelMenuWidth(int width); |
| 108 | 108 |
| 109 // Cancels the active menu. | 109 // Cancels the active menu. |
| 110 void CancelMenu(); | 110 void CancelMenu(); |
| 111 | 111 |
| 112 // Returns the Icon for a network strength between 0 and 100. | 112 // Returns the Icon for a network strength between 0 and 100. |
| 113 // |black| is used to specify whether to return a black icon for display | 113 // |black| is used to specify whether to return a black icon for display |
| 114 // on a light background or a white icon for display on a dark background. | 114 // on a light background or a white icon for display on a dark background. |
| 115 static SkBitmap IconForNetworkStrength(int strength, bool black); | 115 static SkBitmap IconForNetworkStrength(int strength, bool black); |
| 116 | 116 |
| 117 // Returns the Icon for a network strength for CellularNetwork |cellular|. |
| 118 // This returns different colored bars depending on cellular data left. |
| 119 static SkBitmap IconForNetworkStrength(CellularNetwork cellular); |
| 120 |
| 117 // This method will convert the |icon| bitmap to the correct size for display. | 121 // This method will convert the |icon| bitmap to the correct size for display. |
| 118 // If the |badge| icon is not empty, it will draw that on top of the icon. | 122 // If the |badge| icon is not empty, it will draw that on top of the icon. |
| 119 static SkBitmap IconForDisplay(SkBitmap icon, SkBitmap badge); | 123 static SkBitmap IconForDisplay(SkBitmap icon, SkBitmap badge); |
| 120 | 124 |
| 121 protected: | 125 protected: |
| 122 virtual bool IsBrowserMode() const = 0; | 126 virtual bool IsBrowserMode() const = 0; |
| 123 virtual gfx::NativeWindow GetNativeWindow() const = 0; | 127 virtual gfx::NativeWindow GetNativeWindow() const = 0; |
| 124 virtual void OpenButtonOptions() const = 0; | 128 virtual void OpenButtonOptions() const = 0; |
| 125 virtual bool ShouldOpenButtonOptions() const = 0; | 129 virtual bool ShouldOpenButtonOptions() const = 0; |
| 126 | 130 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 void ShowCellular(const CellularNetwork& cellular, bool focus_login) const; | 187 void ShowCellular(const CellularNetwork& cellular, bool focus_login) const; |
| 184 void ShowEthernet(const EthernetNetwork& ethernet) const; | 188 void ShowEthernet(const EthernetNetwork& ethernet) const; |
| 185 void ShowOther() const; | 189 void ShowOther() const; |
| 186 | 190 |
| 187 // Set to true if we are currently refreshing the menu. | 191 // Set to true if we are currently refreshing the menu. |
| 188 bool refreshing_menu_; | 192 bool refreshing_menu_; |
| 189 | 193 |
| 190 // The number of wifi strength images. | 194 // The number of wifi strength images. |
| 191 static const int kNumWifiImages; | 195 static const int kNumWifiImages; |
| 192 | 196 |
| 197 // Bars image resources. |
| 198 static const int kBarsImages[]; |
| 199 static const int kBarsImagesBlack[]; |
| 200 static const int kBarsImagesLowData[]; |
| 201 static const int kBarsImagesVLowData[]; |
| 202 |
| 193 // Our menu items. | 203 // Our menu items. |
| 194 MenuItemVector menu_items_; | 204 MenuItemVector menu_items_; |
| 195 | 205 |
| 196 // The network menu. | 206 // The network menu. |
| 197 scoped_ptr<views::Menu2> network_menu_; | 207 scoped_ptr<views::Menu2> network_menu_; |
| 198 | 208 |
| 199 // Holds minimum width or -1 if it wasn't set up. | 209 // Holds minimum width or -1 if it wasn't set up. |
| 200 int min_width_; | 210 int min_width_; |
| 201 | 211 |
| 202 DISALLOW_COPY_AND_ASSIGN(NetworkMenu); | 212 DISALLOW_COPY_AND_ASSIGN(NetworkMenu); |
| 203 }; | 213 }; |
| 204 | 214 |
| 205 } // namespace chromeos | 215 } // namespace chromeos |
| 206 | 216 |
| 207 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ | 217 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ |
| OLD | NEW |