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. |