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

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

Issue 1477253002: Use a single views::MenuConfig instance for each platform (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplify more things Created 5 years 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.cc
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
index ff2737ea9a89771ed999dba162082f258d34fd55..69828773d4ea7639b4e9d697cffa0a6227a1efa8 100644
--- a/ui/views/controls/menu/menu_item_view.cc
+++ b/ui/views/controls/menu/menu_item_view.cc
@@ -59,6 +59,11 @@ class EmptyMenuMenuItem : public MenuItemView {
DISALLOW_COPY_AND_ASSIGN(EmptyMenuMenuItem);
};
+// Helper that returns a reference to the MenuConfig to be used with menus.
+const MenuConfig& GetMenuConfig() {
+ return MenuConfig::instance();
Evan Stade 2015/12/07 19:51:42 inline this instead of having a helper?
tapted 2015/12/08 11:49:23 Done. I thought it would be a lot of churn, but I
+}
+
} // namespace
// Padding between child views.
@@ -240,7 +245,7 @@ MenuItemView* MenuItemView::AddMenuItemAt(
CreateSubmenu();
DCHECK_GE(submenu_->child_count(), index);
if (type == SEPARATOR) {
- submenu_->AddChildViewAt(new MenuSeparator(this, separator_style), index);
+ submenu_->AddChildViewAt(new MenuSeparator(separator_style), index);
return NULL;
}
MenuItemView* item = new MenuItemView(this, item_id, type);
@@ -567,10 +572,6 @@ void MenuItemView::SetMargins(int top_margin, int bottom_margin) {
invalidate_dimensions();
}
-const MenuConfig& MenuItemView::GetMenuConfig() const {
- return MenuConfig::instance(GetNativeTheme());
-}
-
MenuItemView::MenuItemView(MenuItemView* parent,
int command,
MenuItemView::Type type)

Powered by Google App Engine
This is Rietveld 408576698