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

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

Issue 11026076: Added MenuConfig setter to MenuItemView, updated rest of the code to use set MenuConfig if it avail… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 2 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 4f33f10ed3282d01ab927247f86d382b354052b2..97642affe6df0f5a8684d13fcb2e3471210ac7d3 100644
--- a/ui/views/controls/menu/menu_item_view.h
+++ b/ui/views/controls/menu/menu_item_view.h
@@ -320,6 +320,12 @@ class VIEWS_EXPORT MenuItemView : public View {
use_right_margin_ = use_right_margin;
}
+ // Sets MenuConfig to be used instead of default one.
+ void set_menu_config(MenuConfig* menu_config) { menu_config_ = menu_config; }
sky 2012/10/05 21:33:40 This approach encourages leaking. MenuItemView sho
yefimt 2012/10/08 20:02:47 Yes, was going to do it but forgot :( The best wou
+
+ // Returns a reference to MenuConfig to be used with this menu.
+ const MenuConfig& GetMenuConfig() const;
+
protected:
// Creates a MenuItemView. This is used by the various AddXXX methods.
MenuItemView(MenuItemView* parent, int command, Type type);
@@ -500,6 +506,10 @@ class VIEWS_EXPORT MenuItemView : public View {
// containing other elements.
bool use_right_margin_;
+ // |menu_config_| to replace default one, could be NULL,
+ // applies to root menu item only.
+ const MenuConfig* menu_config_;
+
DISALLOW_COPY_AND_ASSIGN(MenuItemView);
};

Powered by Google App Engine
This is Rietveld 408576698