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

Unified Diff: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/app/nibs/BookmarkEditor.xib ('k') | chrome/browser/ui/cocoa/bookmarks/bookmark_cell_single_line.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
index 28dcab60b293c5974c4f7526defa5aa225e33078..10397ca7e98301bb08282594ee8760f71c73059c 100644
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.mm
@@ -9,6 +9,7 @@
#include "chrome/browser/bookmarks/bookmark_model.h"
#include "chrome/browser/bookmarks/bookmark_utils.h"
#import "chrome/browser/ui/cocoa/bookmarks/bookmark_button.h"
+#import "chrome/browser/ui/cocoa/bookmarks/bookmark_cell_single_line.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/info_bubble_view.h"
#include "content/browser/user_metrics.h"
@@ -106,6 +107,17 @@ void BookmarkBubbleNotificationBridge::Observe(
return self;
}
+- (void)awakeFromNib {
+ // Check if NSTextFieldCell supports the method. This check is in place as
+ // only 10.6 and greater support the setUsesSingleLineMode method.
+ // TODO(kushi.p): Remove this when the project hits a 10.6+ only state.
+ NSTextFieldCell* nameFieldCell_ = [nameTextField_ cell];
+ if ([nameFieldCell_
+ respondsToSelector:@selector(setUsesSingleLineMode:)]) {
+ [nameFieldCell_ setUsesSingleLineMode:YES];
+ }
+}
+
- (void)dealloc {
[[NSNotificationCenter defaultCenter] removeObserver:self];
[super dealloc];
« no previous file with comments | « chrome/app/nibs/BookmarkEditor.xib ('k') | chrome/browser/ui/cocoa/bookmarks/bookmark_cell_single_line.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698