| 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_CONTROLS_MENU_VIEWS_MENU_H_ | 5 #ifndef CHROME_CONTROLS_MENU_VIEWS_MENU_H_ |
| 6 #define CHROME_CONTROLS_MENU_VIEWS_MENU_H_ | 6 #define CHROME_CONTROLS_MENU_VIEWS_MENU_H_ |
| 7 | 7 |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 250 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 261 const SkBitmap& icon); | 261 const SkBitmap& icon); |
| 262 void AddMenuItemWithIcon(int index, | 262 void AddMenuItemWithIcon(int index, |
| 263 int item_id, | 263 int item_id, |
| 264 const std::wstring& label, | 264 const std::wstring& label, |
| 265 const SkBitmap& icon); | 265 const SkBitmap& icon); |
| 266 | 266 |
| 267 // Enables or disables the item with the specified id. | 267 // Enables or disables the item with the specified id. |
| 268 void EnableMenuItemByID(int item_id, bool enabled); | 268 void EnableMenuItemByID(int item_id, bool enabled); |
| 269 void EnableMenuItemAt(int index, bool enabled); | 269 void EnableMenuItemAt(int index, bool enabled); |
| 270 | 270 |
| 271 // Sets menu label at specified index. |
| 272 void SetMenuLabel(int item_id, const std::wstring& label); |
| 273 |
| 271 // Sets an icon for an item with a given item_id. Calling this function | 274 // Sets an icon for an item with a given item_id. Calling this function |
| 272 // also forces the Menu class to draw the menu, instead of relying on Windows. | 275 // also forces the Menu class to draw the menu, instead of relying on Windows. |
| 273 // Returns false if the item with |item_id| is not found. | 276 // Returns false if the item with |item_id| is not found. |
| 274 bool SetIcon(const SkBitmap& icon, int item_id); | 277 bool SetIcon(const SkBitmap& icon, int item_id); |
| 275 | 278 |
| 276 // Shows the menu, blocks until the user dismisses the menu or selects an | 279 // Shows the menu, blocks until the user dismisses the menu or selects an |
| 277 // item, and executes the command for the selected item (if any). | 280 // item, and executes the command for the selected item (if any). |
| 278 // Warning: Blocking call. Will implicitly run a message loop. | 281 // Warning: Blocking call. Will implicitly run a message loop. |
| 279 void RunMenuAt(int x, int y); | 282 void RunMenuAt(int x, int y); |
| 280 | 283 |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 // Our sub-menus, if any. | 346 // Our sub-menus, if any. |
| 344 std::vector<Menu*> submenus_; | 347 std::vector<Menu*> submenus_; |
| 345 | 348 |
| 346 // Whether the menu is visible. | 349 // Whether the menu is visible. |
| 347 bool is_menu_visible_; | 350 bool is_menu_visible_; |
| 348 | 351 |
| 349 DISALLOW_COPY_AND_ASSIGN(Menu); | 352 DISALLOW_COPY_AND_ASSIGN(Menu); |
| 350 }; | 353 }; |
| 351 | 354 |
| 352 #endif // CHROME_CONTROLS_MENU_VIEWS_MENU_H_ | 355 #endif // CHROME_CONTROLS_MENU_VIEWS_MENU_H_ |
| OLD | NEW |