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

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

Issue 2077743005: [Mac][Material Design] Adjust (i) and lock Omnibox icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address review feedback. 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 e768691fac2b039fa5383d607711f964ee1ece75..27d62fe7045e8c0dbd7822bc71d7ad64c0be9e76 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
@@ -174,13 +174,25 @@ const SkColor kMaterialDarkVectorIconColor = 0xCCFFFFFF;
}
+ (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 {
@@ -223,10 +235,17 @@ const SkColor kMaterialDarkVectorIconColor = 0xCCFFFFFF;
}
+ (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];
@@ -240,6 +259,7 @@ const SkColor kMaterialDarkVectorIconColor = 0xCCFFFFFF;
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