OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 5 #ifndef UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
6 #define UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 6 #define UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
419 // Destroys the window used to display this menu and recursively destroys | 419 // Destroys the window used to display this menu and recursively destroys |
420 // the windows used to display all descendants. | 420 // the windows used to display all descendants. |
421 void DestroyAllMenuHosts(); | 421 void DestroyAllMenuHosts(); |
422 | 422 |
423 // Returns the accelerator text. | 423 // Returns the accelerator text. |
424 string16 GetAcceleratorText(); | 424 string16 GetAcceleratorText(); |
425 | 425 |
426 // Calculates and returns the MenuItemDimensions. | 426 // Calculates and returns the MenuItemDimensions. |
427 MenuItemDimensions CalculateDimensions(); | 427 MenuItemDimensions CalculateDimensions(); |
428 | 428 |
| 429 // Get the horizontal position at which to draw the menu item's label. |
| 430 int GetLabelStartForThisItem(); |
| 431 |
429 // Used by MenuController to cache the menu position in use by the | 432 // Used by MenuController to cache the menu position in use by the |
430 // active menu. | 433 // active menu. |
431 MenuPosition actual_menu_position() const { return actual_menu_position_; } | 434 MenuPosition actual_menu_position() const { return actual_menu_position_; } |
432 void set_actual_menu_position(MenuPosition actual_menu_position) { | 435 void set_actual_menu_position(MenuPosition actual_menu_position) { |
433 actual_menu_position_ = actual_menu_position; | 436 actual_menu_position_ = actual_menu_position; |
434 } | 437 } |
435 | 438 |
436 void set_controller(MenuController* controller) { controller_ = controller; } | 439 void set_controller(MenuController* controller) { controller_ = controller; } |
437 | 440 |
438 // Returns true if this MenuItemView contains a single child | 441 // Returns true if this MenuItemView contains a single child |
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 // If set to false, the right margin will be removed for menu lines | 537 // If set to false, the right margin will be removed for menu lines |
535 // containing other elements. | 538 // containing other elements. |
536 bool use_right_margin_; | 539 bool use_right_margin_; |
537 | 540 |
538 DISALLOW_COPY_AND_ASSIGN(MenuItemView); | 541 DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
539 }; | 542 }; |
540 | 543 |
541 } // namespace views | 544 } // namespace views |
542 | 545 |
543 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 546 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
OLD | NEW |