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

Unified Diff: ui/views/controls/menu/menu_item_view.cc

Issue 423833002: Check if the delegate changed the visibility of child MenuItemViews. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Added MenuModelAdapter::IsCommandVisible Created 6 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
« no previous file with comments | « ui/views/controls/menu/menu_delegate.cc ('k') | ui/views/controls/menu/menu_model_adapter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/controls/menu/menu_item_view.cc
diff --git a/ui/views/controls/menu/menu_item_view.cc b/ui/views/controls/menu/menu_item_view.cc
index 0583ff1e9208ddb9822af9dd51b612917bde6e29..f24c61059c6333bb53162fc66a3a579778e1b25a 100644
--- a/ui/views/controls/menu/menu_item_view.cc
+++ b/ui/views/controls/menu/menu_item_view.cc
@@ -254,6 +254,8 @@ MenuItemView* MenuItemView::AddMenuItemAt(
item->SetIcon(icon);
if (type == SUBMENU)
item->CreateSubmenu();
+ if (GetDelegate() && !GetDelegate()->IsCommandVisible(item_id))
+ item->SetVisible(false);
submenu_->AddChildViewAt(item, index);
return item;
}
« no previous file with comments | « ui/views/controls/menu/menu_delegate.cc ('k') | ui/views/controls/menu/menu_model_adapter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698