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

Unified Diff: app/menus/simple_menu_model.cc

Issue 3143046: The "Update Chrome" menu item should appear in addition to the About menu. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: estade fixes -> final try Created 10 years, 4 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 | « app/menus/simple_menu_model.h ('k') | chrome/app/chrome_dll_resource.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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:
« no previous file with comments | « app/menus/simple_menu_model.h ('k') | chrome/app/chrome_dll_resource.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698