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

Unified Diff: chrome/browser/cocoa/bookmark_button_cell.mm

Issue 353024: Mac: Enable OK Button when editing a bookmark text to be blank... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 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/cocoa/bookmark_button_cell.mm
===================================================================
--- chrome/browser/cocoa/bookmark_button_cell.mm (revision 31008)
+++ chrome/browser/cocoa/bookmark_button_cell.mm (working copy)
@@ -34,6 +34,23 @@
return size;
}
+- (void)setBookmarkCellText:(NSString*)title
+ image:(NSImage*)image {
+ title = [title stringByReplacingOccurrencesOfString:@"\n"
+ withString:@" "];
+ title = [title stringByReplacingOccurrencesOfString:@"\r"
+ withString:@" "];
+ if (image) {
+ [self setImage:image];
+ if ([title length] < 1) {
+ [self setImagePosition:NSImageOnly];
+ } else {
+ [self setImagePosition:NSImageLeft];
+ }
+ }
+ [self setTitle:title];
+}
+
// We share the context menu among all bookmark buttons. To allow us
// to disambiguate when needed (e.g. "open bookmark"), we set the
// menu's delegate to be us. We (the cell) have the bookmark encoded

Powered by Google App Engine
This is Rietveld 408576698