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_button_cell.h" | 5 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "base/metrics/user_metrics.h" | 8 #include "base/metrics/user_metrics.h" |
9 #include "base/strings/sys_string_conversions.h" | 9 #include "base/strings/sys_string_conversions.h" |
10 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" | 10 #include "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_constants.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 - (void)configureBookmarkButtonCell; | 74 - (void)configureBookmarkButtonCell; |
75 - (void)applyTextColor; | 75 - (void)applyTextColor; |
76 // Returns the title the button cell displays. Note that a button cell can | 76 // Returns the title the button cell displays. Note that a button cell can |
77 // have a title string assigned but it won't be visible if its image position | 77 // have a title string assigned but it won't be visible if its image position |
78 // is NSImageOnly. | 78 // is NSImageOnly. |
79 - (NSString*)visibleTitle; | 79 - (NSString*)visibleTitle; |
80 // Returns the dictionary of attributes to associate with the button title. | 80 // Returns the dictionary of attributes to associate with the button title. |
81 - (NSDictionary*)titleTextAttributes; | 81 - (NSDictionary*)titleTextAttributes; |
82 @end | 82 @end |
83 | 83 |
84 | |
85 @implementation BookmarkButtonCell | 84 @implementation BookmarkButtonCell |
86 | 85 |
87 @synthesize startingChildIndex = startingChildIndex_; | 86 @synthesize startingChildIndex = startingChildIndex_; |
88 @synthesize drawFolderArrow = drawFolderArrow_; | 87 @synthesize drawFolderArrow = drawFolderArrow_; |
89 | 88 |
90 + (id)buttonCellForNode:(const BookmarkNode*)node | 89 + (id)buttonCellForNode:(const BookmarkNode*)node |
91 text:(NSString*)text | 90 text:(NSString*)text |
92 image:(NSImage*)image | 91 image:(NSImage*)image |
93 menuController:(BookmarkContextMenuCocoaController*)menuController { | 92 menuController:(BookmarkContextMenuCocoaController*)menuController { |
94 id buttonCell = | 93 id buttonCell = |
(...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 | 470 |
472 // Returns |title| with newlines and line feeds replaced with | 471 // Returns |title| with newlines and line feeds replaced with |
473 // spaces. | 472 // spaces. |
474 + (NSString*)cleanTitle:(NSString*)title { | 473 + (NSString*)cleanTitle:(NSString*)title { |
475 title = [title stringByReplacingOccurrencesOfString:@"\n" withString:@" "]; | 474 title = [title stringByReplacingOccurrencesOfString:@"\n" withString:@" "]; |
476 title = [title stringByReplacingOccurrencesOfString:@"\r" withString:@" "]; | 475 title = [title stringByReplacingOccurrencesOfString:@"\r" withString:@" "]; |
477 return title; | 476 return title; |
478 } | 477 } |
479 | 478 |
480 @end | 479 @end |
OLD | NEW |