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

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

Issue 12041085: Fix menu corners: the menu background was being painted as a rect when in fact, (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 7 years, 11 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_config_views.cc ('k') | ui/views/controls/menu/menu_scroll_view_container.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_host.cc
diff --git a/ui/views/controls/menu/menu_host.cc b/ui/views/controls/menu/menu_host.cc
index bea46ac169922e5271b83a90b6788360a65e1370..8c2374b905c6d09a5807cf9614ad96a7a462d8d6 100644
--- a/ui/views/controls/menu/menu_host.cc
+++ b/ui/views/controls/menu/menu_host.cc
@@ -36,16 +36,17 @@ void MenuHost::InitMenuHost(Widget* parent,
params.has_dropshadow = true;
params.parent = parent ? parent->GetNativeView() : NULL;
params.bounds = bounds;
- Init(params);
- if (ui::NativeTheme::IsNewMenuStyleEnabled()) {
- // TODO(yefim): Investigate it more on aura.
- gfx::Path path;
- RoundRectPainter::CreateRoundRectPath(bounds, &path);
- SetShape(path.CreateNativeRegion());
- }
+ const MenuController* menu_controller =
+ submenu_->GetMenuItem()->GetMenuController();
+ const MenuConfig& menu_config = submenu_->GetMenuItem()->GetMenuConfig();
+ if (menu_controller && menu_config.corner_radius > 0)
+ params.transparent = true;
+ Init(params);
SetContentsView(contents_view);
+ if (menu_controller && menu_config.corner_radius > 0)
+ SetOpacity(0);
ShowMenuHost(do_capture);
}
« no previous file with comments | « ui/views/controls/menu/menu_config_views.cc ('k') | ui/views/controls/menu/menu_scroll_view_container.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698