Index: chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm |
diff --git a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm |
index 392c7ca623d000ad1e3d3cd9f8c08cbf94c51ff2..3de541556e8e6777d7ce5d9d9d493493da5954c6 100644 |
--- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm |
+++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm |
@@ -13,7 +13,6 @@ |
#include "content/browser/user_metrics.h" |
#include "grit/generated_resources.h" |
#include "ui/base/l10n/l10n_util_mac.h" |
-#include "ui/gfx/mac/nsimage_cache.h" |
@interface BookmarkButtonCell(Private) |
@@ -25,7 +24,6 @@ |
@implementation BookmarkButtonCell |
@synthesize startingChildIndex = startingChildIndex_; |
-@synthesize drawFolderArrow = drawFolderArrow_; |
+ (id)buttonCellForNode:(const BookmarkNode*)node |
contextMenu:(NSMenu*)contextMenu |
@@ -208,48 +206,4 @@ |
[super mouseExited:event]; |
} |
-- (void)setDrawFolderArrow:(BOOL)draw { |
- drawFolderArrow_ = draw; |
- if (draw && !arrowImage_) { |
- arrowImage_.reset( |
- [gfx::GetCachedImageWithName(@"menu_hierarchy_arrow.pdf") retain]); |
- } |
-} |
- |
-// Add extra size for the arrow so it doesn't overlap the text. |
-// Does not sanity check to be sure this is actually a folder node. |
-- (NSSize)cellSize { |
- NSSize cellSize = [super cellSize]; |
- if (drawFolderArrow_) { |
- cellSize.width += [arrowImage_ size].width; // plus margin? |
- } |
- return cellSize; |
-} |
- |
-// Override cell drawing to add a submenu arrow like a real menu. |
-- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView*)controlView { |
- // First draw "everything else". |
- [super drawInteriorWithFrame:cellFrame inView:controlView]; |
- |
- // If asked to do so, and if a folder, draw the arrow. |
- if (!drawFolderArrow_) |
- return; |
- BookmarkButton* button = static_cast<BookmarkButton*>([self controlView]); |
- DCHECK([button respondsToSelector:@selector(isFolder)]); |
- if ([button isFolder]) { |
- NSRect imageRect = NSZeroRect; |
- imageRect.size = [arrowImage_ size]; |
- const CGFloat kArrowOffset = 1.0; // Required for proper centering. |
- CGFloat dX = NSWidth(cellFrame) - NSWidth(imageRect); |
- CGFloat dY = (NSHeight(cellFrame) / 2.0) - (NSHeight(imageRect) / 2.0) + |
- kArrowOffset; |
- NSRect drawRect = NSOffsetRect(imageRect, dX, dY); |
- [arrowImage_ drawInRect:drawRect |
- fromRect:imageRect |
- operation:NSCompositeSourceOver |
- fraction:[self isEnabled] ? 1.0 : 0.5 |
- neverFlipped:YES]; |
- } |
-} |
- |
@end |