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

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

Issue 6931039: Add MenuItemView API to add and remove items at a particular index. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixed another spurious OVERRIDE. Created 9 years, 8 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: views/controls/menu/menu_controller.cc
diff --git a/views/controls/menu/menu_controller.cc b/views/controls/menu/menu_controller.cc
index 5703d693e99db415b750686263a2655ab3fade1f..eee5f9ff23791bc4e9117d5310513a6dfb48d619 100644
--- a/views/controls/menu/menu_controller.cc
+++ b/views/controls/menu/menu_controller.cc
@@ -1344,14 +1344,11 @@ void MenuController::MenuChildrenChanged(MenuItemView* item) {
DCHECK(item);
DCHECK(item->GetSubmenu()->IsShowing());
- // Currently this only supports adjusting the bounds of the last menu.
- DCHECK(item == state_.item->GetParentMenuItem());
-
// Make sure the submenu isn't showing for the current item (the position may
// have changed or the menu removed). This also moves the selection back to
// the parent, which handles the case where the selected item was removed.
- SetSelection(state_.item->GetParentMenuItem(),
- SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY);
+ if (state_.item)
+ SetSelection(item, SELECTION_OPEN_SUBMENU | SELECTION_UPDATE_IMMEDIATELY);
sky 2011/05/06 16:17:00 This isn't right. It forces the selection to be wh
rhashimoto 2011/05/11 00:44:53 You're right. I've changed this to check if the c
OpenMenuImpl(item, false);
}

Powered by Google App Engine
This is Rietveld 408576698