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

Side by Side Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_name_folder_controller.mm

Issue 8775042: Bookmark name inputs should only allow single-line input (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Add TODO comments for post-10.6+ only good times Created 9 years 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698