Chromium Code Reviews| Index: chrome/browser/ui/cocoa/menu_controller.mm |
| diff --git a/chrome/browser/ui/cocoa/menu_controller.mm b/chrome/browser/ui/cocoa/menu_controller.mm |
| index 47f0c348081994998f065d8afea639f58f71f040..0a96260a187f30f3b6c8e5cc0d0dab215a43b590 100644 |
| --- a/chrome/browser/ui/cocoa/menu_controller.mm |
| +++ b/chrome/browser/ui/cocoa/menu_controller.mm |
| @@ -144,10 +144,23 @@ |
| DCHECK([(id)item isKindOfClass:[NSMenuItem class]]); |
| [(id)item setState:(checked ? NSOnState : NSOffState)]; |
| [(id)item setHidden:(!model->IsVisibleAt(modelIndex))]; |
| - if (model->IsLabelDynamicAt(modelIndex)) { |
| + if (model->IsItemDynamicAt(modelIndex)) { |
| + // Update the label and the icon. |
| NSString* label = |
| l10n_util::FixUpWindowsStyleLabel(model->GetLabelAt(modelIndex)); |
| [(id)item setTitle:label]; |
| + SkBitmap skiaIcon; |
|
Evan Stade
2010/12/14 21:28:57
SkBitmap skiaIcon;
NSImage* icon = nil;
if (model-
|
| + if (model->GetIconAt(modelIndex, &skiaIcon) && !skiaIcon.isNull()) { |
| + // We have an icon. |
| + NSImage* icon = gfx::SkBitmapToNSImage(skiaIcon); |
| + if (icon) |
| + [(id)item setImage:icon]; |
| + else |
| + [(id)item setImage:nil]; |
| + } else { |
| + // No icon. |
| + [(id)item setImage:nil]; |
| + } |
| } |
| return model->IsEnabledAt(modelIndex); |
| } |