OLD | NEW |
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 "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.h" |
6 | 6 |
7 #include "base/mac/mac_util.h" | 7 #include "base/mac/mac_util.h" |
8 #include "base/sys_string_conversions.h" | 8 #include "base/sys_string_conversions.h" |
9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_cell_single_line.h" | 10 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_cell_single_line.h" |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 node:nil | 65 node:nil |
66 parent:parent | 66 parent:parent |
67 newIndex:newIndex]; | 67 newIndex:newIndex]; |
68 } | 68 } |
69 | 69 |
70 - (void)awakeFromNib { | 70 - (void)awakeFromNib { |
71 [nameField_ setStringValue:initialName_.get()]; | 71 [nameField_ setStringValue:initialName_.get()]; |
72 | 72 |
73 // Check if NSTextFieldCell supports the method. This check is in place as | 73 // Check if NSTextFieldCell supports the method. This check is in place as |
74 // only 10.6 and greater support the setUsesSingleLineMode method. | 74 // only 10.6 and greater support the setUsesSingleLineMode method. |
| 75 // TODO(kushi.p): Remove this when the project hits a 10.6+ only state. |
75 NSTextFieldCell* nameFieldCell_ = [nameField_ cell]; | 76 NSTextFieldCell* nameFieldCell_ = [nameField_ cell]; |
76 if ([nameFieldCell_ | 77 if ([nameFieldCell_ |
77 respondsToSelector:@selector(setUsesSingleLineMode:)]) { | 78 respondsToSelector:@selector(setUsesSingleLineMode:)]) { |
78 [nameFieldCell_ setUsesSingleLineMode:YES]; | 79 [nameFieldCell_ setUsesSingleLineMode:YES]; |
79 } | 80 } |
80 } | 81 } |
81 | 82 |
82 - (void)runAsModalSheet { | 83 - (void)runAsModalSheet { |
83 // Ping me when things change out from under us. | 84 // Ping me when things change out from under us. |
84 observer_.reset(new BookmarkModelObserverForCocoa( | 85 observer_.reset(new BookmarkModelObserverForCocoa( |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 | 124 |
124 - (void)setFolderName:(NSString*)name { | 125 - (void)setFolderName:(NSString*)name { |
125 [nameField_ setStringValue:name]; | 126 [nameField_ setStringValue:name]; |
126 } | 127 } |
127 | 128 |
128 - (NSButton*)okButton { | 129 - (NSButton*)okButton { |
129 return okButton_; | 130 return okButton_; |
130 } | 131 } |
131 | 132 |
132 @end // BookmarkNameFolderController | 133 @end // BookmarkNameFolderController |
OLD | NEW |