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

Side by Side Diff: chrome/browser/cocoa/menu_controller.mm

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 | « chrome/browser/browser.cc ('k') | chrome/browser/gtk/menu_gtk.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) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #import "chrome/browser/cocoa/menu_controller.h" 5 #import "chrome/browser/cocoa/menu_controller.h"
6 6
7 #include "app/l10n_util_mac.h" 7 #include "app/l10n_util_mac.h"
8 #include "app/menus/accelerator_cocoa.h" 8 #include "app/menus/accelerator_cocoa.h"
9 #include "app/menus/simple_menu_model.h" 9 #include "app/menus/simple_menu_model.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after
136 136
137 NSInteger modelIndex = [item tag]; 137 NSInteger modelIndex = [item tag];
138 menus::MenuModel* model = 138 menus::MenuModel* model =
139 static_cast<menus::MenuModel*>( 139 static_cast<menus::MenuModel*>(
140 [[(id)item representedObject] pointerValue]); 140 [[(id)item representedObject] pointerValue]);
141 DCHECK(model); 141 DCHECK(model);
142 if (model) { 142 if (model) {
143 BOOL checked = model->IsItemCheckedAt(modelIndex); 143 BOOL checked = model->IsItemCheckedAt(modelIndex);
144 DCHECK([(id)item isKindOfClass:[NSMenuItem class]]); 144 DCHECK([(id)item isKindOfClass:[NSMenuItem class]]);
145 [(id)item setState:(checked ? NSOnState : NSOffState)]; 145 [(id)item setState:(checked ? NSOnState : NSOffState)];
146 [(id)item setHidden:(!model->IsVisibleAt(modelIndex))];
146 if (model->IsLabelDynamicAt(modelIndex)) { 147 if (model->IsLabelDynamicAt(modelIndex)) {
147 NSString* label = 148 NSString* label =
148 l10n_util::FixUpWindowsStyleLabel(model->GetLabelAt(modelIndex)); 149 l10n_util::FixUpWindowsStyleLabel(model->GetLabelAt(modelIndex));
149 [(id)item setTitle:label]; 150 [(id)item setTitle:label];
150 } 151 }
151 return model->IsEnabledAt(modelIndex); 152 return model->IsEnabledAt(modelIndex);
152 } 153 }
153 return NO; 154 return NO;
154 } 155 }
155 156
(...skipping 19 matching lines...) Expand all
175 if (useWithPopUpButtonCell_) { 176 if (useWithPopUpButtonCell_) {
176 scoped_nsobject<NSMenuItem> blankItem( 177 scoped_nsobject<NSMenuItem> blankItem(
177 [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]); 178 [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""]);
178 [menu_ insertItem:blankItem atIndex:0]; 179 [menu_ insertItem:blankItem atIndex:0];
179 } 180 }
180 } 181 }
181 return menu_.get(); 182 return menu_.get();
182 } 183 }
183 184
184 @end 185 @end
OLDNEW
« no previous file with comments | « chrome/browser/browser.cc ('k') | chrome/browser/gtk/menu_gtk.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698