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

Side by Side Diff: app/menus/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, 3 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 unified diff | Download patch
« no previous file with comments | « app/menus/menu_model.h ('k') | app/menus/simple_menu_model.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "app/menus/menu_model.h" 5 #include "app/menus/menu_model.h"
6 6
7 namespace menus { 7 namespace menus {
8 8
9 bool MenuModel::IsVisibleAt(int index) const {
10 return true;
11 }
12
9 bool MenuModel::GetModelAndIndexForCommandId(int command_id, 13 bool MenuModel::GetModelAndIndexForCommandId(int command_id,
10 MenuModel** model, int* index) { 14 MenuModel** model, int* index) {
11 int item_count = (*model)->GetItemCount(); 15 int item_count = (*model)->GetItemCount();
12 for (int i = 0; i < item_count; ++i) { 16 for (int i = 0; i < item_count; ++i) {
13 if ((*model)->GetTypeAt(i) == TYPE_SUBMENU) { 17 if ((*model)->GetTypeAt(i) == TYPE_SUBMENU) {
14 MenuModel* submenu_model = (*model)->GetSubmenuModelAt(i); 18 MenuModel* submenu_model = (*model)->GetSubmenuModelAt(i);
15 if (GetModelAndIndexForCommandId(command_id, &submenu_model, index)) { 19 if (GetModelAndIndexForCommandId(command_id, &submenu_model, index)) {
16 *model = submenu_model; 20 *model = submenu_model;
17 return true; 21 return true;
18 } 22 }
19 } 23 }
20 if ((*model)->GetCommandIdAt(i) == command_id) { 24 if ((*model)->GetCommandIdAt(i) == command_id) {
21 *index = i; 25 *index = i;
22 return true; 26 return true;
23 } 27 }
24 } 28 }
25 return false; 29 return false;
26 } 30 }
27 31
28 } // namespace 32 } // namespace
OLDNEW
« no previous file with comments | « app/menus/menu_model.h ('k') | app/menus/simple_menu_model.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698