Index: app/menus/simple_menu_model.cc |
diff --git a/app/menus/simple_menu_model.cc b/app/menus/simple_menu_model.cc |
index 6a40f755600fe45fb5c9011fafe14df3ae5603eb..b645b098305b6e3debbf74768b603f56693ba2b4 100644 |
--- a/app/menus/simple_menu_model.cc |
+++ b/app/menus/simple_menu_model.cc |
@@ -24,6 +24,10 @@ struct SimpleMenuModel::Item { |
//////////////////////////////////////////////////////////////////////////////// |
// SimpleMenuModel::Delegate, public: |
+bool SimpleMenuModel::Delegate::IsCommandIdVisible(int command_id) const { |
+ return true; |
+} |
+ |
bool SimpleMenuModel::Delegate::IsLabelForCommandIdDynamic( |
int command_id) const { |
return false; |
@@ -250,6 +254,14 @@ bool SimpleMenuModel::IsEnabledAt(int index) const { |
return delegate_->IsCommandIdEnabled(command_id); |
} |
+bool SimpleMenuModel::IsVisibleAt(int index) const { |
+ int command_id = GetCommandIdAt(index); |
+ if (!delegate_ || command_id == kSeparatorId || |
+ items_.at(FlipIndex(index)).button_model) |
+ return true; |
+ return delegate_->IsCommandIdVisible(command_id); |
+} |
+ |
void SimpleMenuModel::HighlightChangedTo(int index) { |
if (delegate_) |
delegate_->CommandIdHighlighted(GetCommandIdAt(index)); |
@@ -264,6 +276,10 @@ MenuModel* SimpleMenuModel::GetSubmenuModelAt(int index) const { |
return items_.at(FlipIndex(index)).submenu; |
} |
+int SimpleMenuModel::FlipIndex(int index) const { |
+ return index; |
+} |
+ |
//////////////////////////////////////////////////////////////////////////////// |
// SimpleMenuModel, Private: |