summaryrefslogtreecommitdiffstats
path: root/chrome/browser/app_controller_mac.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/app_controller_mac.mm')
-rw-r--r--chrome/browser/app_controller_mac.mm26
1 files changed, 12 insertions, 14 deletions
diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm
index aee634b..3a65d3e 100644
--- a/chrome/browser/app_controller_mac.mm
+++ b/chrome/browser/app_controller_mac.mm
@@ -652,27 +652,25 @@
}
- (NSMenu*)applicationDockMenu:(id)sender {
- NSMenu* result = [[[NSMenu alloc] initWithTitle: @""] autorelease];
- NSString* titleStr;
- id item;
-
- titleStr = l10n_util::GetNSStringWithFixup(IDS_NEW_WINDOW_MAC);
- item = [[[NSMenuItem alloc] initWithTitle:titleStr
- action:@selector(commandDispatch:)
- keyEquivalent:@""] autorelease];
+ NSMenu* dockMenu = [[[NSMenu alloc] initWithTitle: @""] autorelease];
+ NSString* titleStr = l10n_util::GetNSStringWithFixup(IDS_NEW_WINDOW_MAC);
+ scoped_nsobject<NSMenuItem> item([[NSMenuItem alloc]
+ initWithTitle:titleStr
+ action:@selector(commandDispatch:)
+ keyEquivalent:@""]);
[item setTarget:self];
[item setTag:IDC_NEW_WINDOW];
- [result addItem:item];
+ [dockMenu addItem:item];
titleStr = l10n_util::GetNSStringWithFixup(IDS_NEW_INCOGNITO_WINDOW_MAC);
- item = [[[NSMenuItem alloc] initWithTitle:titleStr
- action:@selector(commandDispatch:)
- keyEquivalent:@""] autorelease];
+ item.reset([[NSMenuItem alloc] initWithTitle:titleStr
+ action:@selector(commandDispatch:)
+ keyEquivalent:@""]);
[item setTarget:self];
[item setTag:IDC_NEW_INCOGNITO_WINDOW];
- [result addItem:item];
+ [dockMenu addItem:item];
- return result;
+ return dockMenu;
}
@end