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 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
83 } | 83 } |
84 | 84 |
85 - (IBAction)cancel:(id)sender { | 85 - (IBAction)cancel:(id)sender { |
86 [NSApp endSheet:[self window]]; | 86 [NSApp endSheet:[self window]]; |
87 } | 87 } |
88 | 88 |
89 - (IBAction)ok:(id)sender { | 89 - (IBAction)ok:(id)sender { |
90 NSString* name = [nameField_ stringValue]; | 90 NSString* name = [nameField_ stringValue]; |
91 BookmarkModel* model = profile_->GetBookmarkModel(); | 91 BookmarkModel* model = profile_->GetBookmarkModel(); |
92 if (node_) { | 92 if (node_) { |
93 model->SetTitle(node_, base::SysNSStringToWide(name)); | 93 model->SetTitle(node_, base::SysNSStringToUTF16(name)); |
94 } else { | 94 } else { |
95 model->AddGroup(parent_, | 95 model->AddGroup(parent_, |
96 newIndex_, | 96 newIndex_, |
97 base::SysNSStringToUTF16(name)); | 97 base::SysNSStringToUTF16(name)); |
98 } | 98 } |
99 [NSApp endSheet:[self window]]; | 99 [NSApp endSheet:[self window]]; |
100 } | 100 } |
101 | 101 |
102 - (void)didEndSheet:(NSWindow*)sheet | 102 - (void)didEndSheet:(NSWindow*)sheet |
103 returnCode:(int)returnCode | 103 returnCode:(int)returnCode |
104 contextInfo:(void*)contextInfo { | 104 contextInfo:(void*)contextInfo { |
105 [[self window] orderOut:self]; | 105 [[self window] orderOut:self]; |
106 observer_.reset(NULL); | 106 observer_.reset(NULL); |
107 [self autorelease]; | 107 [self autorelease]; |
108 } | 108 } |
109 | 109 |
110 - (NSString*)folderName { | 110 - (NSString*)folderName { |
111 return [nameField_ stringValue]; | 111 return [nameField_ stringValue]; |
112 } | 112 } |
113 | 113 |
114 - (void)setFolderName:(NSString*)name { | 114 - (void)setFolderName:(NSString*)name { |
115 [nameField_ setStringValue:name]; | 115 [nameField_ setStringValue:name]; |
116 } | 116 } |
117 | 117 |
118 - (NSButton*)okButton { | 118 - (NSButton*)okButton { |
119 return okButton_; | 119 return okButton_; |
120 } | 120 } |
121 | 121 |
122 @end // BookmarkNameFolderController | 122 @end // BookmarkNameFolderController |
OLD | NEW |