| 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 67 return NULL; | 67 return NULL; |
| 68 } | 68 } |
| 69 virtual bool IsEnabledAt(int index) const; | 69 virtual bool IsEnabledAt(int index) const; |
| 70 virtual menus::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } | 70 virtual menus::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } |
| 71 virtual void HighlightChangedTo(int index) {} | 71 virtual void HighlightChangedTo(int index) {} |
| 72 virtual void ActivatedAt(int index); | 72 virtual void ActivatedAt(int index); |
| 73 virtual void MenuWillShow() {} | 73 virtual void MenuWillShow() {} |
| 74 | 74 |
| 75 void SetFirstLevelMenuWidth(int width); | 75 void SetFirstLevelMenuWidth(int width); |
| 76 | 76 |
| 77 void set_menu_offset(int delta_x, int delta_y) { | |
| 78 delta_x_ = delta_x; | |
| 79 delta_y_ = delta_y; | |
| 80 } | |
| 81 | |
| 82 // Cancels the active menu. | 77 // Cancels the active menu. |
| 83 void CancelMenu(); | 78 void CancelMenu(); |
| 84 | 79 |
| 85 // Returns the Icon for a network strength between 0 and 100. | 80 // Returns the Icon for a network strength between 0 and 100. |
| 86 // |black| is used to specify whether to return a black icon for display | 81 // |black| is used to specify whether to return a black icon for display |
| 87 // on a light background or a white icon for display on a dark background. | 82 // on a light background or a white icon for display on a dark background. |
| 88 static SkBitmap IconForNetworkStrength(int strength, bool black); | 83 static SkBitmap IconForNetworkStrength(int strength, bool black); |
| 89 | 84 |
| 90 // This method will convert the |icon| bitmap to the correct size for display. | 85 // This method will convert the |icon| bitmap to the correct size for display. |
| 91 // If the |badge| icon is not empty, it will draw that on top of the icon. | 86 // If the |badge| icon is not empty, it will draw that on top of the icon. |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 147 | 142 |
| 148 // The number of wifi strength images. | 143 // The number of wifi strength images. |
| 149 static const int kNumWifiImages; | 144 static const int kNumWifiImages; |
| 150 | 145 |
| 151 // Our menu items. | 146 // Our menu items. |
| 152 MenuItemVector menu_items_; | 147 MenuItemVector menu_items_; |
| 153 | 148 |
| 154 // The network menu. | 149 // The network menu. |
| 155 views::Menu2 network_menu_; | 150 views::Menu2 network_menu_; |
| 156 | 151 |
| 157 int delta_x_, delta_y_; | 152 // Holds minimum width or -1 if it wasn't set up. |
| 153 int min_width_; |
| 158 | 154 |
| 159 DISALLOW_COPY_AND_ASSIGN(NetworkMenu); | 155 DISALLOW_COPY_AND_ASSIGN(NetworkMenu); |
| 160 }; | 156 }; |
| 161 | 157 |
| 162 } // namespace chromeos | 158 } // namespace chromeos |
| 163 | 159 |
| 164 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ | 160 #endif // CHROME_BROWSER_CHROMEOS_STATUS_NETWORK_MENU_H_ |
| OLD | NEW |