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

Unified Diff: chrome/browser/app_controller_mac.mm

Issue 6241009: Moving Background App support on the Mac Dock menu into its own submenu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Submenus work Created 9 years, 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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];
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698