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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 | 258 |
259 // Returns the command id of this item. | 259 // Returns the command id of this item. |
260 int GetCommand() const { return command_; } | 260 int GetCommand() const { return command_; } |
261 | 261 |
262 // Paints the menu item. | 262 // Paints the menu item. |
263 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; | 263 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; |
264 | 264 |
265 // Returns the preferred size of this item. | 265 // Returns the preferred size of this item. |
266 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 266 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
267 | 267 |
| 268 // Gets the preferred height for the given |width|. This is only different |
| 269 // from GetPreferredSize().width() if the item has a child view with flexible |
| 270 // dimensions. |
| 271 virtual int GetHeightForWidth(int width) const OVERRIDE; |
| 272 |
268 // Return the preferred dimensions of the item in pixel. | 273 // Return the preferred dimensions of the item in pixel. |
269 const MenuItemDimensions& GetDimensions() const; | 274 const MenuItemDimensions& GetDimensions() const; |
270 | 275 |
271 // Returns the object responsible for controlling showing the menu. | 276 // Returns the object responsible for controlling showing the menu. |
272 MenuController* GetMenuController(); | 277 MenuController* GetMenuController(); |
273 const MenuController* GetMenuController() const; | 278 const MenuController* GetMenuController() const; |
274 | 279 |
275 // Returns the delegate. This returns the delegate of the root menu item. | 280 // Returns the delegate. This returns the delegate of the root menu item. |
276 MenuDelegate* GetDelegate(); | 281 MenuDelegate* GetDelegate(); |
277 const MenuDelegate* GetDelegate() const; | 282 const MenuDelegate* GetDelegate() const; |
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
511 // If set to false, the right margin will be removed for menu lines | 516 // If set to false, the right margin will be removed for menu lines |
512 // containing other elements. | 517 // containing other elements. |
513 bool use_right_margin_; | 518 bool use_right_margin_; |
514 | 519 |
515 DISALLOW_COPY_AND_ASSIGN(MenuItemView); | 520 DISALLOW_COPY_AND_ASSIGN(MenuItemView); |
516 }; | 521 }; |
517 | 522 |
518 } // namespace views | 523 } // namespace views |
519 | 524 |
520 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ | 525 #endif // UI_VIEWS_CONTROLS_MENU_MENU_ITEM_VIEW_H_ |
OLD | NEW |