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

Unified Diff: views/controls/menu/menu_controller.cc

Issue 7076027: Couple more wrench menu issues. The patch I sent around a couple of (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Makes unit test compile Created 9 years, 7 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 | « chrome/browser/ui/views/wrench_menu.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/controls/menu/menu_controller.cc
diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc
index a59caacc9ca35f20ff51b2d2618fb68650837243..022f1767dc722f22069c054c01c1157f82b52ab9 100644
--- a/views/controls/menu/menu_controller.cc
+++ b/views/controls/menu/menu_controller.cc
@@ -1325,8 +1325,14 @@ void MenuController::OpenMenu(MenuItemView* item) {
}
void MenuController::OpenMenuImpl(MenuItemView* item, bool show) {
- if (show)
+ if (show) {
+ int old_count = item->GetSubmenu()->child_count();
item->GetDelegate()->WillShowMenu(item);
+ if (old_count != item->GetSubmenu()->child_count()) {
+ // If the number of children changed then we may need to add empty items.
+ item->AddEmptyMenus();
+ }
+ }
bool prefer_leading =
state_.open_leading.empty() ? true : state_.open_leading.back();
bool resulting_direction;
« no previous file with comments | « chrome/browser/ui/views/wrench_menu.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698