| 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/bookmark_name_folder_controller.h" | 5 #import "chrome/browser/cocoa/bookmark_name_folder_controller.h" |
| 6 #include "app/l10n_util.h" | 6 #include "app/l10n_util.h" |
| 7 #include "app/l10n_util_mac.h" | 7 #include "app/l10n_util_mac.h" |
| 8 #include "base/mac_util.h" | 8 #include "base/mac_util.h" |
| 9 #include "base/sys_string_conversions.h" | 9 #include "base/sys_string_conversions.h" |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { | 25 if ((self = [super initWithWindowNibPath:nibpath owner:self])) { |
| 26 parentWindow_ = window; | 26 parentWindow_ = window; |
| 27 profile_ = profile; | 27 profile_ = profile; |
| 28 node_ = node; | 28 node_ = node; |
| 29 parent_ = parent; | 29 parent_ = parent; |
| 30 newIndex_ = newIndex; | 30 newIndex_ = newIndex; |
| 31 if (parent) { | 31 if (parent) { |
| 32 DCHECK_LE(newIndex, parent->GetChildCount()); | 32 DCHECK_LE(newIndex, parent->GetChildCount()); |
| 33 } | 33 } |
| 34 if (node_) { | 34 if (node_) { |
| 35 initialName_.reset([base::SysWideToNSString(node_->GetTitle()) retain]); | 35 initialName_.reset( |
| 36 [base::SysUTF16ToNSString(node_->GetTitleAsString16()) retain]); |
| 36 } else { | 37 } else { |
| 37 NSString* newString = | 38 NSString* newString = |
| 38 l10n_util::GetNSStringWithFixup(IDS_BOOMARK_EDITOR_NEW_FOLDER_NAME); | 39 l10n_util::GetNSStringWithFixup(IDS_BOOMARK_EDITOR_NEW_FOLDER_NAME); |
| 39 initialName_.reset([newString retain]); | 40 initialName_.reset([newString retain]); |
| 40 } | 41 } |
| 41 } | 42 } |
| 42 return self; | 43 return self; |
| 43 } | 44 } |
| 44 | 45 |
| 45 - (id)initWithParentWindow:(NSWindow*)window | 46 - (id)initWithParentWindow:(NSWindow*)window |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 | 114 |
| 114 - (void)setFolderName:(NSString*)name { | 115 - (void)setFolderName:(NSString*)name { |
| 115 [nameField_ setStringValue:name]; | 116 [nameField_ setStringValue:name]; |
| 116 } | 117 } |
| 117 | 118 |
| 118 - (NSButton*)okButton { | 119 - (NSButton*)okButton { |
| 119 return okButton_; | 120 return okButton_; |
| 120 } | 121 } |
| 121 | 122 |
| 122 @end // BookmarkNameFolderController | 123 @end // BookmarkNameFolderController |
| OLD | NEW |