| Index: chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm
|
| diff --git a/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm b/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm
|
| index 2a8efd6d0a80757f4b46226debf7ec729781568f..f3878f1f5b8465edc537281c7fc76aa2f7fb754d 100644
|
| --- a/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm
|
| +++ b/chrome/browser/ui/cocoa/location_bar/security_state_bubble_decoration.mm
|
| @@ -32,6 +32,9 @@ namespace {
|
| // Padding between the label and icon/divider.
|
| CGFloat kLabelPadding = 4.0;
|
|
|
| +// Divider height.
|
| +CGFloat kDividerHeight = 16.0;
|
| +
|
| // Inset for the background.
|
| const CGFloat kBackgroundYInset = 4.0;
|
|
|
| @@ -232,15 +235,29 @@ void SecurityStateBubbleDecoration::DrawInFrame(NSRect frame,
|
|
|
| // Draw the divider.
|
| if (state() == DecorationMouseState::NONE && !active()) {
|
| - const CGFloat divider_x_position =
|
| - is_rtl ? NSMinX(decoration_frame) + DividerPadding()
|
| - : NSMaxX(decoration_frame) - DividerPadding();
|
| NSBezierPath* line = [NSBezierPath bezierPath];
|
| [line setLineWidth:line_width];
|
| - [line moveToPoint:NSMakePoint(divider_x_position,
|
| - NSMinY(decoration_frame))];
|
| - [line lineToPoint:NSMakePoint(divider_x_position,
|
| - NSMaxY(decoration_frame))];
|
| + NSPoint divider_origin = NSZeroPoint;
|
| + divider_origin.x = is_rtl ? NSMinX(decoration_frame) + DividerPadding()
|
| + : NSMaxX(decoration_frame) - DividerPadding();
|
| + // Screen pixels lay between integral coordinates in user space. If you
|
| + // draw a line from (16, 16) to (16, 32), Core Graphics maps that line to
|
| + // the pixels that lay along x=16.5. In order to achieve a line that
|
| + // appears to lay along x=16, CG will perform dithering. To get a crisp
|
| + // line, you have to specify x=16.5, so translating by 1/2 the 1-pixel
|
| + // line width creates the crisp line we want. We subtract to better center
|
| + // the line between the label and URL.
|
| + divider_origin.x -= line_width / 2.;
|
| + CGFloat divider_y_frame_offset =
|
| + (NSHeight(decoration_frame) - kDividerHeight) / 2.0;
|
| + divider_origin.y = NSMinY(decoration_frame) + divider_y_frame_offset;
|
| + // Adjust the divider origin by 1/2 a point to visually center the
|
| + // divider vertically on Retina.
|
| + if (line_width < 1) {
|
| + divider_origin.y -= 0.5;
|
| + }
|
| + [line moveToPoint:divider_origin];
|
| + [line relativeLineToPoint:NSMakePoint(0, kDividerHeight)];
|
|
|
| NSColor* divider_color = GetDividerColor(in_dark_mode);
|
| CGFloat divider_alpha =
|
|
|