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

Side by Side Diff: chrome/browser/cocoa/bookmark_editor_base_controller.mm

Issue 3113028: Remove wstrings from bookmarks, part 8. (Closed)
Patch Set: Created 10 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
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 #include <stack> 5 #include <stack>
6 6
7 #import "chrome/browser/cocoa/bookmark_editor_base_controller.h" 7 #import "chrome/browser/cocoa/bookmark_editor_base_controller.h"
8 #include "app/l10n_util.h" 8 #include "app/l10n_util.h"
9 #include "app/l10n_util_mac.h" 9 #include "app/l10n_util_mac.h"
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
388 DCHECK([path length] == stackSize); 388 DCHECK([path length] == stackSize);
389 return path; 389 return path;
390 } 390 }
391 391
392 - (NSMutableArray*)addChildFoldersFromNode:(const BookmarkNode*)node { 392 - (NSMutableArray*)addChildFoldersFromNode:(const BookmarkNode*)node {
393 NSMutableArray* childFolders = nil; 393 NSMutableArray* childFolders = nil;
394 int childCount = node->GetChildCount(); 394 int childCount = node->GetChildCount();
395 for (int i = 0; i < childCount; ++i) { 395 for (int i = 0; i < childCount; ++i) {
396 const BookmarkNode* childNode = node->GetChild(i); 396 const BookmarkNode* childNode = node->GetChild(i);
397 if (childNode->type() != BookmarkNode::URL) { 397 if (childNode->type() != BookmarkNode::URL) {
398 NSString* childName = base::SysWideToNSString(childNode->GetTitle()); 398 NSString* childName =
399 base::SysUTF16ToNSString(childNode->GetTitleAsString16());
399 NSMutableArray* children = [self addChildFoldersFromNode:childNode]; 400 NSMutableArray* children = [self addChildFoldersFromNode:childNode];
400 BookmarkFolderInfo* folderInfo = 401 BookmarkFolderInfo* folderInfo =
401 [BookmarkFolderInfo bookmarkFolderInfoWithFolderName:childName 402 [BookmarkFolderInfo bookmarkFolderInfoWithFolderName:childName
402 folderNode:childNode 403 folderNode:childNode
403 children:children]; 404 children:children];
404 if (!childFolders) 405 if (!childFolders)
405 childFolders = [NSMutableArray arrayWithObject:folderInfo]; 406 childFolders = [NSMutableArray arrayWithObject:folderInfo];
406 else 407 else
407 [childFolders addObject:folderInfo]; 408 [childFolders addObject:folderInfo];
408 } 409 }
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 } 595 }
595 596
596 // Implementing isEqual: allows the NSTreeController to preserve the selection 597 // Implementing isEqual: allows the NSTreeController to preserve the selection
597 // and open/shut state of outline items when the data changes. 598 // and open/shut state of outline items when the data changes.
598 - (BOOL)isEqual:(id)other { 599 - (BOOL)isEqual:(id)other {
599 return [other isKindOfClass:[BookmarkFolderInfo class]] && 600 return [other isKindOfClass:[BookmarkFolderInfo class]] &&
600 folderNode_ == [(BookmarkFolderInfo*)other folderNode]; 601 folderNode_ == [(BookmarkFolderInfo*)other folderNode];
601 } 602 }
602 603
603 @end 604 @end
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/bookmark_button_cell.mm ('k') | chrome/browser/cocoa/bookmark_editor_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698