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

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

Issue 7541002: Make NetworkMenuModel a ui::MenuModel again. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Better fix for NOTREACHED(). Created 9 years, 5 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_model_adapter.cc
diff --git a/views/controls/menu/menu_model_adapter.cc b/views/controls/menu/menu_model_adapter.cc
index 90a99dbcbab91352b72398e890c5afe0bc5941b6..e2c895d4349148823ef769d5ae9bccdccb90a06c 100644
--- a/views/controls/menu/menu_model_adapter.cc
+++ b/views/controls/menu/menu_model_adapter.cc
@@ -32,7 +32,11 @@ void MenuModelAdapter::BuildMenu(MenuItemView* menu) {
menu->RemoveMenuItemAt(0);
}
- menu_map_.clear();
+ // Leave entries in the map if the menu is being shown. This
+ // allows the map to find the menu model of submenus being closed
+ // so ui::MenuModel::MenuClosed() can be called.
+ if (!menu->GetMenuController())
sky 2011/08/02 15:54:56 Can you add a test for coverage of this case.
rhashimoto 2011/08/02 23:04:07 Done.
+ menu_map_.clear();
menu_map_[menu] = menu_model_;
// Repopulate the menu.
« views/controls/menu/menu_item_view.h ('K') | « views/controls/menu/menu_item_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698