Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5919)

Unified Diff: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm

Issue 2102853002: [Mac][Material Design] Adjust (i) and lock Omnibox icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
index 41e190060eda3e854d075feaf99a398783ea383b..1172aab7e7befebdc6044a0023991f8606bfc091 100644
--- a/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
+++ b/chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm
@@ -173,13 +173,25 @@ const SkColor kMaterialDarkVectorIconColor = SK_ColorWHITE;
}
+ (void)drawLocationBarIconHTTPForScale:(int)scaleFactor {
- NSBezierPath* circlePath =
- [NSBezierPath bezierPathWithOvalInRect:NSMakeRect(2, 2, 12, 12)];
- [circlePath setLineWidth:1.5];
- [circlePath stroke];
-
- NSRectFill(NSMakeRect(7, 4, 2, 5));
- NSRectFill(NSMakeRect(7, 10, 2, 2));
+ if (scaleFactor > 1) {
+ NSRect ovalRect = NSMakeRect(2.25, 1.75, 12, 12);
+ NSBezierPath* circlePath =
+ [NSBezierPath bezierPathWithOvalInRect:ovalRect];
+ [circlePath setLineWidth:1.5];
+ [circlePath stroke];
+
+ NSRectFill(NSMakeRect(7.5, 4.5, 1.5, 4));
+ NSRectFill(NSMakeRect(7.5, 9.5, 1.5, 1.5));
+ } else {
+ NSRect ovalRect = NSMakeRect(2, 2, 12, 12);
+ NSBezierPath* circlePath =
+ [NSBezierPath bezierPathWithOvalInRect:ovalRect];
+ [circlePath setLineWidth:1.5];
+ [circlePath stroke];
+
+ NSRectFill(NSMakeRect(7, 4, 2, 5));
+ NSRectFill(NSMakeRect(7, 10, 2, 2));
+ }
}
+ (void)drawLocationBarIconHTTPSInvalidForScale:(int)scaleFactor {
@@ -222,10 +234,17 @@ const SkColor kMaterialDarkVectorIconColor = SK_ColorWHITE;
}
+ (void)drawLocationBarIconHTTPSValidForScale:(int)scaleFactor {
+ NSAffineTransform* transform = [NSAffineTransform transform];
+ // Adjust down 1px in Retina, so that the lock sits on the text baseline.
+ if (scaleFactor > 1) {
+ [transform translateXBy:0 yBy:-0.5];
+ }
+
NSBezierPath* rectPath =
[NSBezierPath bezierPathWithRoundedRect:NSMakeRect(4, 3, 8, 7)
xRadius:1
yRadius:1];
+ [rectPath transformUsingAffineTransform:transform];
[rectPath fill];
NSBezierPath* curvePath = [NSBezierPath bezierPath];
@@ -239,6 +258,7 @@ const SkColor kMaterialDarkVectorIconColor = SK_ColorWHITE;
controlPoint2:NSMakePoint(10.5, 13)];
[curvePath lineToPoint:NSMakePoint(10.5, 9.75)];
[curvePath setLineWidth:1.25];
+ [curvePath transformUsingAffineTransform:transform];
[curvePath stroke];
}
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/ev_bubble_decoration.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698