| Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
|
| diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
|
| index a8bb4629c524dc8ad0f9f5ab4ac2dae33165c493..ef0ddd32bb4a27bded9a8c6c2e74e7097deb1ec5 100644
|
| --- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
|
| +++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
|
| @@ -351,13 +351,56 @@
|
| // Draw the border.
|
| if (isModeMaterial) {
|
| if (!inDarkMode) {
|
| - const CGFloat kNormalStrokeGray = 168 / 255.;
|
| - [[NSColor colorWithCalibratedWhite:kNormalStrokeGray alpha:1] set];
|
| + [[NSColor colorWithCalibratedWhite:168 / 255. alpha:1] set];
|
| + [path stroke];
|
| } else {
|
| - const CGFloat k30PercentAlpha = 0.3;
|
| - [[NSColor colorWithCalibratedWhite:0 alpha:k30PercentAlpha] set];
|
| + // In dark mode the top, middle, and bottom portions of the stroke are
|
| + // drawn in different colors.
|
| + {
|
| + gfx::ScopedNSGraphicsContextSaveGState saveState;
|
| + [[NSColor colorWithCalibratedWhite:52 / 255. alpha:1] set];
|
| + [NSBezierPath clipRect:NSMakeRect(NSMinX(frame), NSMaxY(frame) - 2,
|
| + NSWidth(frame), 2)];
|
| + [path stroke];
|
| + }
|
| + {
|
| + gfx::ScopedNSGraphicsContextSaveGState saveState;
|
| + [[NSColor colorWithCalibratedWhite:61 / 255. alpha:1] set];
|
| + [NSBezierPath clipRect:NSMakeRect(NSMinX(frame), NSMinY(frame) + 3,
|
| + NSWidth(frame), NSHeight(frame) - 5)];
|
| + [path stroke];
|
| + }
|
| + {
|
| + gfx::ScopedNSGraphicsContextSaveGState saveState;
|
| + [[NSColor colorWithCalibratedWhite:71 / 255. alpha:1] set];
|
| + [NSBezierPath clipRect:NSMakeRect(NSMinX(frame), NSMinY(frame),
|
| + NSWidth(frame), 3)];
|
| + [path stroke];
|
| + }
|
| +
|
| + // Draw a highlight beneath the top edge, and a shadow beneath the bottom
|
| + // edge when on a Retina screen.
|
| + {
|
| + gfx::ScopedNSGraphicsContextSaveGState saveState;
|
| + [NSBezierPath setDefaultLineWidth:singlePixelLineWidth_];
|
| +
|
| + [[NSColor colorWithCalibratedWhite:120 / 255. alpha:1] set];
|
| + NSPoint origin = NSMakePoint(NSMinX(pathRect) + 3,
|
| + NSMinY(pathRect) + singlePixelLineWidth_);
|
| + NSPoint destination =
|
| + NSMakePoint(NSMaxX(pathRect) - 3,
|
| + NSMinY(pathRect) + singlePixelLineWidth_);
|
| + [NSBezierPath strokeLineFromPoint:origin
|
| + toPoint:destination];
|
| +
|
| + if (singlePixelLineWidth_ < 1) {
|
| + origin.y = destination.y = NSMaxY(pathRect) + singlePixelLineWidth_;
|
| + [[AutocompleteTextField shadowColor] set];
|
| + [NSBezierPath strokeLineFromPoint:origin
|
| + toPoint:destination];
|
| + }
|
| + }
|
| }
|
| - [path stroke];
|
| } else {
|
| ui::DrawNinePartImage(frame,
|
| isPopupMode_ ? kPopupBorderImageIds
|
|
|