| 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 67f2aa5433f113d3b391ed3f95b5982fa315a21b..a2501080a4674d5946de73a7ad7bd7ef9af875a5 100644
|
| --- a/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
|
| +++ b/chrome/browser/ui/cocoa/bookmarks/bookmark_button_cell.mm
|
| @@ -39,7 +39,19 @@ const int kDefaultFontSize = 12;
|
|
|
| }; // namespace
|
|
|
| +@interface OffTheSideButtonCell : BookmarkButtonCell
|
| +@end
|
| +@implementation OffTheSideButtonCell
|
| +
|
| +- (BOOL)isOffTheSideButtonCell {
|
| + return YES;
|
| +}
|
| +
|
| +@end
|
| +
|
| @interface BookmarkButtonCell(Private)
|
| +// Returns YES if the cell is the offTheSide button cell.
|
| +- (BOOL)isOffTheSideButtonCell;
|
| - (void)configureBookmarkButtonCell;
|
| - (void)applyTextColor;
|
| // Returns the title the button cell displays. Note that a button cell can
|
| @@ -143,6 +155,10 @@ const int kDefaultFontSize = 12;
|
| return NO;
|
| }
|
|
|
| +- (BOOL)isOffTheSideButtonCell {
|
| + return NO;
|
| +}
|
| +
|
| // Perform all normal init routines specific to the BookmarkButtonCell.
|
| - (void)configureBookmarkButtonCell {
|
| [self setButtonType:NSMomentaryPushInButton];
|
| @@ -373,11 +389,17 @@ const int kDefaultFontSize = 12;
|
|
|
| - (void)drawFocusRingMaskWithFrame:(NSRect)cellFrame
|
| inView:(NSView*)controlView {
|
| - // In Material Design we have to move the focus ring over by 2 pts to get it
|
| - // to line up with the image.
|
| - if (ui::MaterialDesignController::IsModeMaterial() &&
|
| - [self visibleTitle].length > 0) {
|
| - cellFrame.origin.x += 2;
|
| + if (ui::MaterialDesignController::IsModeMaterial()) {
|
| + // In Material Design we have to move the focus ring over by 2 pts to get it
|
| + // to line up with the image.
|
| + if ([self visibleTitle].length > 0) {
|
| + cellFrame.origin.x += 2;
|
| + }
|
| +
|
| + // We also have to nudge the chevron button's focus ring up 2pts.
|
| + if ([self isOffTheSideButtonCell]) {
|
| + cellFrame.origin.y -= 2;
|
| + }
|
| }
|
| [super drawFocusRingMaskWithFrame:cellFrame inView:controlView];
|
| }
|
|
|