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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_editor_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: Created 9 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
index ebe06d174b66dc765c12669345f35f4b0a33984a..a44b498cced7f19c8ff81fc1d844390f0b2ceb5c 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_editor_controller.mm
@@ -9,6 +9,7 @@
#include "chrome/browser/bookmarks/bookmark_expanded_state_tracker.h"
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
+#import "chrome/browser/ui/cocoa/bookmarks/bookmark_cell_single_line.h"
#include "ui/base/l10n/l10n_util.h"
@interface BookmarkEditorController (Private)
@@ -48,6 +49,14 @@
}
- (void)awakeFromNib {
+ // Check if NSTextFieldCell supports the method. This check is in place as
mrossetti 2011/12/02 15:52:22 Add TODO(kushalp): here, too.
+ // only 10.6 and greater support the setUsesSingleLineMode method.
+ NSTextFieldCell* nameFieldCell_ = [nameTextField_ cell];
+ if ([nameFieldCell_
+ respondsToSelector:@selector(setUsesSingleLineMode:)]) {
+ [nameFieldCell_ setUsesSingleLineMode:YES];
+ }
+
// Set text fields to match our bookmark. If the node is NULL we
// arrived here from an "Add Page..." item in a context menu.
if (node_) {

Powered by Google App Engine
This is Rietveld 408576698