Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(233)

Unified Diff: ui/views/controls/menu/menu_item_view.h

Issue 553233002: Dynamically calculate the number of extension icons to show per row in overflow (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't resize menu to accommodate Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: ui/views/controls/menu/menu_item_view.h
diff --git a/ui/views/controls/menu/menu_item_view.h b/ui/views/controls/menu/menu_item_view.h
index 4f0ea441caa60e9eabdd3077309e947fc69151c0..86ceebacee61f56e0658290b8590006c2dd4b168 100644
--- a/ui/views/controls/menu/menu_item_view.h
+++ b/ui/views/controls/menu/menu_item_view.h
@@ -265,6 +265,11 @@ class VIEWS_EXPORT MenuItemView : public View {
// Returns the preferred size of this item.
virtual 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.
+ virtual int GetHeightForWidth(int width) const OVERRIDE;
+
// Return the preferred dimensions of the item in pixel.
const MenuItemDimensions& GetDimensions() const;
@@ -419,7 +424,7 @@ class VIEWS_EXPORT MenuItemView : public View {
// Returns true if the menu has items with a checkbox or a radio button.
bool HasChecksOrRadioButtons() const;
- void invalidate_dimensions() { dimensions_.height = 0; }
+ void invalidate_dimensions() const { dimensions_.height = 0; }
sky 2014/09/12 20:09:37 This shouldn't be const. It's modifying a member.
Devlin 2014/09/12 22:41:37 |dimensions_| are mutable, because it's just a val
bool is_dimensions_valid() const { return dimensions_.height > 0; }
// The delegate. This is only valid for the root menu item. You shouldn't

Powered by Google App Engine
This is Rietveld 408576698