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

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

Issue 7044016: Replace ButtonDropDown menu implementation (Menu2) with MenuItemView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: One last little style fix. 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 | « views/controls/button/button_dropdown.cc ('k') | views/controls/menu/menu_delegate.h » ('j') | 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..1b513d104e06257d1cc2d065ff1163eda8fc523c 100644
--- a/views/controls/menu/menu_controller.cc
+++ b/views/controls/menu/menu_controller.cc
@@ -758,8 +758,15 @@ void MenuController::SetSelection(MenuItemView* menu_item,
}
// Notify the old path it isn't selected.
- for (size_t i = paths_differ_at; i < current_size; ++i)
+ MenuDelegate* current_delegate =
+ current_path.empty() ? NULL : current_path.front()->GetDelegate();
+ for (size_t i = paths_differ_at; i < current_size; ++i) {
+ if (current_delegate &&
+ current_path[i]->GetType() == MenuItemView::SUBMENU) {
+ current_delegate->WillHideMenu(current_path[i]);
+ }
current_path[i]->SetSelected(false);
+ }
// Notify the new path it is selected.
for (size_t i = paths_differ_at; i < new_size; ++i)
« no previous file with comments | « views/controls/button/button_dropdown.cc ('k') | views/controls/menu/menu_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698