Chromium Code Reviews| Index: chrome/browser/app_controller_mac.mm |
| diff --git a/chrome/browser/app_controller_mac.mm b/chrome/browser/app_controller_mac.mm |
| index 426af0ce9d093e069fd765a0c2810e992d65d5ea..b7728c1296731938e263a7b42922e1d7dddf9fa5 100644 |
| --- a/chrome/browser/app_controller_mac.mm |
| +++ b/chrome/browser/app_controller_mac.mm |
| @@ -1202,21 +1202,29 @@ void RecordLastRunAppBundlePath() { |
| if (profile) { |
| int position = 0; |
|
John Gregg
2011/01/20 19:58:26
move declaration of position inside if block
The wrong rickcam account
2011/01/20 22:13:37
Done.
|
| BackgroundApplicationListModel applications(profile); |
| - for (ExtensionList::const_iterator cursor = applications.begin(); |
| - cursor != applications.end(); |
| - ++cursor, ++position) { |
| - DCHECK(position == applications.GetPosition(*cursor)); |
| - scoped_nsobject<NSMenuItem> appItem([[NSMenuItem alloc] |
| - initWithTitle:base::SysUTF16ToNSString(UTF8ToUTF16((*cursor)->name())) |
| + if (applications.size()) { |
| + scoped_nsobject<NSMenu> appMenu([[NSMenu alloc] initWithTitle: @"Background apps"]); |
|
John Gregg
2011/01/20 19:58:26
80 char. How is that raw string okay for i18n?
Andrew T Wilson (Slow)
2011/01/20 20:02:33
See below (GetNSStringXXXX) for examples of how to
The wrong rickcam account
2011/01/20 22:13:37
Done. It appears that content of the string is un
|
| + for (ExtensionList::const_iterator cursor = applications.begin(); |
| + cursor != applications.end(); |
| + ++cursor, ++position) { |
| + DCHECK(position == applications.GetPosition(*cursor)); |
| + scoped_nsobject<NSMenuItem> appItem([[NSMenuItem alloc] |
| + initWithTitle:base:: |
| + SysUTF16ToNSString(UTF8ToUTF16((*cursor)->name())) |
| + action:@selector(commandFromDock:) |
| + keyEquivalent:@""]); |
| + [appItem setTarget:self]; |
| + [appItem setTag:position]; |
| + [appMenu addItem:appItem]; |
| + } |
| + scoped_nsobject<NSMenuItem> appMenuItem([[NSMenuItem alloc] |
| + initWithTitle:base::SysUTF16ToNSString(UTF8ToUTF16("Background apps")) |
|
The wrong rickcam account
2011/01/20 22:13:37
Replaced "Background apps" with a localized NSStri
|
| action:@selector(commandFromDock:) |
| keyEquivalent:@""]); |
|
John Gregg
2011/01/20 19:58:26
formatting in this function is inconsistent with O
The wrong rickcam account
2011/01/20 22:13:37
Done. Touched up a few other spots that had the s
|
| - [appItem setTarget:self]; |
| - [appItem setTag:position]; |
| - [dockMenu addItem:appItem]; |
| - } |
| - if (applications.begin() != applications.end()) { |
| - NSMenuItem* sepItem = [[NSMenuItem separatorItem] init]; |
| - [dockMenu addItem:sepItem]; |
| + [appMenuItem setTarget:self]; |
| + [appMenuItem setTag:position]; |
| + [appMenuItem setSubmenu:appMenu]; |
| + [dockMenu addItem:appMenuItem]; |
| } |
| } |