OLD | NEW |
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 #import "chrome/browser/cocoa/cookie_tree_node.h" | 5 #import "chrome/browser/cocoa/cookie_tree_node.h" |
6 | 6 |
7 #include "base/sys_string_conversions.h" | 7 #include "base/sys_string_conversions.h" |
8 | 8 |
9 @implementation CocoaCookieTreeNode | 9 @implementation CocoaCookieTreeNode |
10 | 10 |
11 - (id)initWithNode:(CookieTreeNode*)node { | 11 - (id)initWithNode:(CookieTreeNode*)node { |
12 if ((self = [super init])) { | 12 if ((self = [super init])) { |
13 DCHECK(node); | 13 DCHECK(node); |
14 treeNode_ = node; | 14 treeNode_ = node; |
15 [self rebuild]; | 15 [self rebuild]; |
16 } | 16 } |
17 return self; | 17 return self; |
18 } | 18 } |
19 | 19 |
20 - (void)rebuild { | 20 - (void)rebuild { |
21 title_.reset([base::SysWideToNSString(treeNode_->GetTitle()) retain]); | 21 title_.reset( |
| 22 [base::SysUTF16ToNSString(treeNode_->GetTitleAsString16()) retain]); |
22 children_.reset(); | 23 children_.reset(); |
23 // The tree node assumes ownership of the cookie details object | 24 // The tree node assumes ownership of the cookie details object |
24 details_.reset([[CocoaCookieDetails createFromCookieTreeNode:(treeNode_)] | 25 details_.reset([[CocoaCookieDetails createFromCookieTreeNode:(treeNode_)] |
25 retain]); | 26 retain]); |
26 } | 27 } |
27 | 28 |
28 - (NSString*)title { | 29 - (NSString*)title { |
29 return title_.get(); | 30 return title_.get(); |
30 } | 31 } |
31 | 32 |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
64 @"<CocoaCookieTreeNode @ %p (title=%@, nodeType=%d, childCount=%u)"; | 65 @"<CocoaCookieTreeNode @ %p (title=%@, nodeType=%d, childCount=%u)"; |
65 return [NSString stringWithFormat:format, self, [self title], | 66 return [NSString stringWithFormat:format, self, [self title], |
66 [self nodeType], [[self children] count]]; | 67 [self nodeType], [[self children] count]]; |
67 } | 68 } |
68 | 69 |
69 - (CocoaCookieDetails*)details { | 70 - (CocoaCookieDetails*)details { |
70 return details_; | 71 return details_; |
71 } | 72 } |
72 | 73 |
73 @end | 74 @end |
OLD | NEW |