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

Unified Diff: chrome/browser/ui/views/toolbar/extension_toolbar_menu_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: 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: chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h
diff --git a/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h b/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h
index 69f8e33745abfab912776120a8c122a353923951..3e16781f201a64b2b48959715f21b3cd3b5bd17a 100644
--- a/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h
+++ b/chrome/browser/ui/views/toolbar/extension_toolbar_menu_view.h
@@ -14,6 +14,10 @@ class Browser;
class BrowserActionsContainer;
class WrenchMenu;
+namespace views {
+class MenuItemView;
+}
+
// ExtensionToolbarMenuView is the view containing the extension actions that
// overflowed from the BrowserActionsContainer, and is contained in and owned by
// the wrench menu.
@@ -25,6 +29,10 @@ class ExtensionToolbarMenuView : public views::View,
ExtensionToolbarMenuView(Browser* browser, WrenchMenu* wrench_menu);
virtual ~ExtensionToolbarMenuView();
+ // Initialize the view and have it calculate the number of icons that will
+ // be shown on each row. This will likely cause a change in menu width.
+ void Init(views::MenuItemView* menu_root);
+
// views::View:
virtual gfx::Size GetPreferredSize() const OVERRIDE;
virtual void Layout() OVERRIDE;
@@ -45,6 +53,12 @@ class ExtensionToolbarMenuView : public views::View,
ScopedObserver<BrowserActionsContainer, BrowserActionsContainerObserver>
browser_actions_container_observer_;
+ // The padding before the container's view.
+ int start_padding_;
+
+ // The padding between the container and the edge of the menu.
+ int end_padding_;
+
DISALLOW_COPY_AND_ASSIGN(ExtensionToolbarMenuView);
};

Powered by Google App Engine
This is Rietveld 408576698