| Index: ui/views/controls/menu/menu_item_view.cc
|
| diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
|
| index 8755c024dd3b0c44c82bf110670a1ba7179c6315..4bd7090e9d56dc465b45c33c330334bc93217b04 100644
|
| --- a/ui/views/controls/menu/menu_item_view.cc
|
| +++ b/ui/views/controls/menu/menu_item_view.cc
|
| @@ -410,6 +410,24 @@ gfx::Size MenuItemView::GetPreferredSize() const {
|
| dimensions.height);
|
| }
|
|
|
| +int MenuItemView::GetHeightForWidth(int width) const {
|
| + // If this isn't a container, we can just use the preferred size's height.
|
| + if (!IsContainer())
|
| + return GetPreferredSize().height();
|
| +
|
| + int height = child_at(0)->GetHeightForWidth(width);
|
| + if (!icon_view_ && GetRootMenuItem()->has_icons())
|
| + height = std::max(height, GetMenuConfig().check_height);
|
| + height += GetBottomMargin() + GetTopMargin();
|
| +
|
| + // There's a chance our dimensions changed as a result of this. If so,
|
| + // invalidate them so they get recalculated as needed.
|
| + if (is_dimensions_valid() && height != GetDimensions().height)
|
| + invalidate_dimensions();
|
| +
|
| + return height;
|
| +}
|
| +
|
| const MenuItemView::MenuItemDimensions& MenuItemView::GetDimensions() const {
|
| if (!is_dimensions_valid())
|
| dimensions_ = CalculateDimensions();
|
|
|