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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.mm

Issue 7619007: [Mac] Call GetNSStringWithFixup() instead of just GetNSString() for bookmark menu items. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 <AppKit/AppKit.h> 5 #import <AppKit/AppKit.h>
6 6
7 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h" 7 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_menu_bridge.h"
8 8
9 #include "base/sys_string_conversions.h" 9 #include "base/sys_string_conversions.h"
10 #include "chrome/app/chrome_command_ids.h" 10 #include "chrome/app/chrome_command_ids.h"
(...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after
268 IDS_BOOMARK_BAR_OPEN_INCOGNITO, 268 IDS_BOOMARK_BAR_OPEN_INCOGNITO,
269 node, menu, enabled); 269 node, menu, enabled);
270 } 270 }
271 } 271 }
272 272
273 void BookmarkMenuBridge::AddItemToMenu(int command_id, 273 void BookmarkMenuBridge::AddItemToMenu(int command_id,
274 int message_id, 274 int message_id,
275 const BookmarkNode* node, 275 const BookmarkNode* node,
276 NSMenu* menu, 276 NSMenu* menu,
277 bool enabled) { 277 bool enabled) {
278 NSString* title = l10n_util::GetNSString(message_id); 278 NSString* title = l10n_util::GetNSStringWithFixup(message_id);
279 SEL action; 279 SEL action;
280 if (!enabled) { 280 if (!enabled) {
281 // A nil action makes a menu item appear disabled. NSMenuItem setEnabled 281 // A nil action makes a menu item appear disabled. NSMenuItem setEnabled
282 // will not reflect the disabled state until the item title is set again. 282 // will not reflect the disabled state until the item title is set again.
283 action = nil; 283 action = nil;
284 } else if (command_id == IDC_BOOKMARK_BAR_OPEN_ALL) { 284 } else if (command_id == IDC_BOOKMARK_BAR_OPEN_ALL) {
285 action = @selector(openAllBookmarks:); 285 action = @selector(openAllBookmarks:);
286 } else if (command_id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) { 286 } else if (command_id == IDC_BOOKMARK_BAR_OPEN_ALL_NEW_WINDOW) {
287 action = @selector(openAllBookmarksNewWindow:); 287 action = @selector(openAllBookmarksNewWindow:);
288 } else { 288 } else {
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
324 324
325 NSMenuItem* BookmarkMenuBridge::MenuItemForNode(const BookmarkNode* node) { 325 NSMenuItem* BookmarkMenuBridge::MenuItemForNode(const BookmarkNode* node) {
326 if (!node) 326 if (!node)
327 return nil; 327 return nil;
328 std::map<const BookmarkNode*, NSMenuItem*>::iterator it = 328 std::map<const BookmarkNode*, NSMenuItem*>::iterator it =
329 bookmark_nodes_.find(node); 329 bookmark_nodes_.find(node);
330 if (it == bookmark_nodes_.end()) 330 if (it == bookmark_nodes_.end())
331 return nil; 331 return nil;
332 return it->second; 332 return it->second;
333 } 333 }
OLDNEW
« 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