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

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

Issue 11088037: Revert 160886 - Added MenuConfig setter to MenuItemView, updated rest of the code to use set MenuCo… (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
« no previous file with comments | « ui/views/controls/menu/menu_item_view_win.cc ('k') | ui/views/controls/menu/menu_separator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_scroll_view_container.cc
===================================================================
--- ui/views/controls/menu/menu_scroll_view_container.cc (revision 160892)
+++ ui/views/controls/menu/menu_scroll_view_container.cc (working copy)
@@ -48,9 +48,8 @@
}
virtual gfx::Size GetPreferredSize() {
- return gfx::Size(
- host_->GetMenuItem()->GetMenuConfig().scroll_arrow_height * 2 - 1,
- pref_height_);
+ return gfx::Size(MenuConfig::instance().scroll_arrow_height * 2 - 1,
+ pref_height_);
}
virtual bool CanDrop(const OSExchangeData& data) {
@@ -78,7 +77,7 @@
}
virtual void OnPaint(gfx::Canvas* canvas) {
- const MenuConfig& config = host_->GetMenuItem()->GetMenuConfig();
+ const MenuConfig& config = MenuConfig::instance();
// The background.
gfx::Rect item_bounds(0, 0, width(), height());
@@ -185,18 +184,7 @@
MenuDelegate* delegate = content_view_->GetMenuItem()->GetDelegate();
if (delegate) {
- Border* border = delegate->CreateMenuBorder();
- if (!border) {
- const MenuConfig& menu_config =
- content_view_->GetMenuItem()->GetMenuConfig();
- border = Border::CreateEmptyBorder(
- menu_config.submenu_vertical_margin_size,
- menu_config.submenu_horizontal_margin_size,
- menu_config.submenu_vertical_margin_size,
- menu_config.submenu_horizontal_margin_size);
- }
- set_border(border);
-
+ set_border(delegate->CreateMenuBorder());
set_background(delegate->CreateMenuBackground());
}
}
« no previous file with comments | « ui/views/controls/menu/menu_item_view_win.cc ('k') | ui/views/controls/menu/menu_separator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698