| 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 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 382 | 382 |
| 383 // Given bounds within our View, this helper routine mirrors the bounds if | 383 // Given bounds within our View, this helper routine mirrors the bounds if |
| 384 // necessary. | 384 // necessary. |
| 385 void AdjustBoundsForRTLUI(gfx::Rect* rect) const; | 385 void AdjustBoundsForRTLUI(gfx::Rect* rect) const; |
| 386 | 386 |
| 387 // Actual paint implementation. If mode is PB_FOR_DRAG, portions of the menu | 387 // Actual paint implementation. If mode is PB_FOR_DRAG, portions of the menu |
| 388 // are not rendered. | 388 // are not rendered. |
| 389 void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode); | 389 void PaintButton(gfx::Canvas* canvas, PaintButtonMode mode); |
| 390 | 390 |
| 391 // Paints the right-side text. | 391 // Paints the right-side text. |
| 392 void PaintMinorText(gfx::Canvas* canvas, bool render_selection); | 392 void PaintMinorText(gfx::Canvas* canvas, SkColor color); |
| 393 | 393 |
| 394 // Destroys the window used to display this menu and recursively destroys | 394 // Destroys the window used to display this menu and recursively destroys |
| 395 // the windows used to display all descendants. | 395 // the windows used to display all descendants. |
| 396 void DestroyAllMenuHosts(); | 396 void DestroyAllMenuHosts(); |
| 397 | 397 |
| 398 // Returns the text that should be displayed on the end (right) of the menu | 398 // Returns the text that should be displayed on the end (right) of the menu |
| 399 // item. This will be the accelerator (if one exists), otherwise |subtitle_|. | 399 // item. This will be the accelerator (if one exists), otherwise |subtitle_|. |
| 400 base::string16 GetMinorText() const; | 400 base::string16 GetMinorText() const; |
| 401 | 401 |
| 402 // Returns the text color for the current state. |minor| specifies if the |
| 403 // minor text or the normal text is desired. |
| 404 SkColor GetTextColor(bool minor, |
| 405 bool render_selection, |
| 406 bool emphasized) const; |
| 407 |
| 402 // Calculates and returns the MenuItemDimensions. | 408 // Calculates and returns the MenuItemDimensions. |
| 403 MenuItemDimensions CalculateDimensions() const; | 409 MenuItemDimensions CalculateDimensions() const; |
| 404 | 410 |
| 405 // Get the horizontal position at which to draw the menu item's label. | 411 // Get the horizontal position at which to draw the menu item's label. |
| 406 int GetLabelStartForThisItem() const; | 412 int GetLabelStartForThisItem() const; |
| 407 | 413 |
| 408 // Used by MenuController to cache the menu position in use by the | 414 // Used by MenuController to cache the menu position in use by the |
| 409 // active menu. | 415 // active menu. |
| 410 MenuPosition actual_menu_position() const { return actual_menu_position_; } | 416 MenuPosition actual_menu_position() const { return actual_menu_position_; } |
| 411 void set_actual_menu_position(MenuPosition actual_menu_position) { | 417 void set_actual_menu_position(MenuPosition actual_menu_position) { |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 519 // If set to false, the right margin will be removed for menu lines | 525 // If set to false, the right margin will be removed for menu lines |
| 520 // containing other elements. | 526 // containing other elements. |
| 521 bool use_right_margin_; | 527 bool use_right_margin_; |
| 522 | 528 |
| 523 DISALLOW_COPY_AND_ASSIGN(MenuItemView); | 529 DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
| 524 }; | 530 }; |
| 525 | 531 |
| 526 } // namespace views | 532 } // namespace views |
| 527 | 533 |
| 528 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 534 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
| OLD | NEW |