Chromium Code Reviews| Index: chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm |
| diff --git a/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm b/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm |
| index 92dd23f985a34f5e67b16ecb8617858b0119cd8e..a8e31305836a961292179ac88744cc929c472017 100644 |
| --- a/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm |
| +++ b/chrome/browser/ui/cocoa/download/download_shelf_view_cocoa.mm |
| @@ -16,7 +16,7 @@ |
| // For programmatic instantiations in unit tests. |
| - (id)initWithFrame:(NSRect)frameRect { |
| if ((self = [super initWithFrame:frameRect])) { |
| - [self setShowsDivider:NO]; |
| + self.dividerEdge = NSRectEdgeMaxY; |
| } |
| return self; |
| } |
| @@ -24,26 +24,11 @@ |
| // For nib instantiations in production. |
| - (id)initWithCoder:(NSCoder*)decoder { |
| if ((self = [super initWithCoder:decoder])) { |
| - [self setShowsDivider:NO]; |
| + self.dividerEdge = NSRectEdgeMaxY; |
| } |
| return self; |
| } |
| -- (NSColor*)strokeColor { |
| - const ui::ThemeProvider* themeProvider = [[self window] themeProvider]; |
| - if (!themeProvider) { |
| - return [NSColor blackColor]; |
| - } |
| - if (!ui::MaterialDesignController::IsModeMaterial()) { |
| - BOOL isActive = [[self window] isMainWindow]; |
| - return themeProvider->GetNSColor( |
| - isActive ? ThemeProperties::COLOR_TOOLBAR_STROKE : |
| - ThemeProperties::COLOR_TOOLBAR_STROKE_INACTIVE); |
| - } |
| - return themeProvider->GetNSColor( |
| - ThemeProperties::COLOR_DETACHED_BOOKMARK_BAR_SEPARATOR); |
| -} |
| - |
| - (NSPoint)patternPhase { |
| // We want our backgrounds for the shelf to be phased from the upper |
| // left hand corner of the view. Offset it by tab height so that the |
| @@ -54,18 +39,10 @@ |
| - (void)drawRect:(NSRect)dirtyRect { |
| [super drawRect:dirtyRect]; |
| - |
| - // Draw top stroke |
| - NSRect borderRect, contentRect; |
| - NSDivideRect([self bounds], &borderRect, &contentRect, [self cr_lineWidth], |
| - NSMaxYEdge); |
| - if (NSIntersectsRect(borderRect, dirtyRect)) { |
| - [[self strokeColor] set]; |
| - NSRectFillUsingOperation(NSIntersectionRect(borderRect, dirtyRect), |
| - NSCompositeSourceOver); |
| - } |
| - |
| // Draw the top highlight |
| + NSRect borderRect, contentRect; |
| + NSDivideRect([self bounds], &borderRect, &contentRect, |
| + [self cr_lineWidth] * 2, NSMaxYEdge); |
|
Nico
2016/09/14 18:06:37
is the `* 2` here correct? from what I understand,
Sidney San Martín
2016/09/14 18:34:37
Ugh, I read that parameter as affecting position,
|
| borderRect.origin.y -= [self cr_lineWidth]; |
| if (NSIntersectsRect(borderRect, dirtyRect)) { |
| const ui::ThemeProvider* themeProvider = [[self window] themeProvider]; |