explicit MenuItemView(MenuDelegate* delegate);
// Overridden from View:
- virtual bool GetTooltipText(const gfx::Point& p,
- base::string16* tooltip) const OVERRIDE;
- virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
+ bool GetTooltipText(const gfx::Point& p,
+ base::string16* tooltip) const override;
+ void GetAccessibleState(ui::AXViewState* state) override;
// Returns the preferred height of menu items. This is only valid when the
// menu is about to be shown.
int GetCommand() const { return command_; }
// Paints the menu item.
- virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
+ void OnPaint(gfx::Canvas* canvas) override;
// Returns the preferred size of this item.
- virtual gfx::Size GetPreferredSize() const OVERRIDE;
+ gfx::Size GetPreferredSize() const override;
+
+ // Gets the preferred height for the given |width|. This is only different
+ // from GetPreferredSize().width() if the item has a child view with flexible
+ // dimensions.
+ int GetHeightForWidth(int width) const override;
// Return the preferred dimensions of the item in pixel.
const MenuItemDimensions& GetDimensions() const;
void ChildrenChanged();
// Sizes any child views.
- virtual void Layout() OVERRIDE;
+ void Layout() override;
// Returns true if the menu has mnemonics. This only useful on the root menu
// item.
MenuItemView(MenuItemView* parent, int command, Type type);
// MenuRunner owns MenuItemView and should be the only one deleting it.
- virtual ~MenuItemView();
+ ~MenuItemView() override;
- virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
+ void ChildPreferredSizeChanged(View* child) override;
- virtual const char* GetClassName() const OVERRIDE;
+ const char* GetClassName() const override;
// Returns the preferred size (and padding) of any children.
virtual gfx::Size GetChildPreferredSize() const;