summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_controller.mm
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_controller.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_controller.mm15
1 files changed, 7 insertions, 8 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_controller.mm b/chrome/browser/cocoa/bookmark_bar_controller.mm
index a9d9ba4..8909574 100644
--- a/chrome/browser/cocoa/bookmark_bar_controller.mm
+++ b/chrome/browser/cocoa/bookmark_bar_controller.mm
@@ -594,14 +594,13 @@
// TODO(jrg): move much of the cell config into the BookmarkButtonCell class.
- (NSCell*)cellForBookmarkNode:(const BookmarkNode*)node {
NSString* title = base::SysWideToNSString(node->GetTitle());
- NSButtonCell *cell = [[[BookmarkButtonCell alloc] initTextCell:nil]
- autorelease];
+ BookmarkButtonCell* cell =
+ [[[BookmarkButtonCell alloc] initTextCell:nil] autorelease];
DCHECK(cell);
[cell setRepresentedObject:[NSValue valueWithPointer:node]];
- [cell setImage:[self getFavIconForNode:node]];
- [cell setImagePosition:NSImageLeft];
- [cell setTitle:title];
+ NSImage* image = [self getFavIconForNode:node];
+ [cell setBookmarkCellText:title image:image];
[cell setMenu:buttonContextMenu_];
return cell;
}
@@ -862,12 +861,12 @@
- (void)nodeFavIconLoaded:(BookmarkModel*)model
node:(const BookmarkNode*)node {
for (NSButton* button in buttons_.get()) {
- NSButtonCell* cell = [button cell];
+ BookmarkButtonCell* cell = [button cell];
void* pointer = [[cell representedObject] pointerValue];
const BookmarkNode* cellnode = static_cast<const BookmarkNode*>(pointer);
if (cellnode == node) {
- [cell setImage:[self getFavIconForNode:node]];
- [cell setImagePosition:NSImageLeft];
+ [cell setBookmarkCellText:[cell title]
+ image:[self getFavIconForNode:node]];
// Adding an image means we might need more room for the
// bookmark. Test for it by growing the button (if needed)
// and shifting everything else over.