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

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

Issue 2013183003: [Mac][Material Design] Bring Omnibox stroke and MD colors up to spec. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compile error. Created 4 years, 7 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
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 4a120eaf18c940112485ed46e3b6a428ddb135cf..455280ce6ef23e06c07af110c69335476cbd805e 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,56 +351,13 @@ size_t CalculatePositionsInFrame(
// Draw the border.
if (isModeMaterial) {
if (!inDarkMode) {
- [[NSColor colorWithCalibratedWhite:168 / 255. alpha:1] set];
- [path stroke];
+ const CGFloat kNormalStrokeGray = 168 / 255.;
+ [[NSColor colorWithCalibratedWhite:kNormalStrokeGray alpha:1] set];
} else {
- // 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];
- }
- }
+ const CGFloat k30PercentAlpha = 0.3;
+ [[NSColor colorWithCalibratedWhite:0 alpha:k30PercentAlpha] set];
}
+ [path stroke];
} else {
ui::DrawNinePartImage(frame,
isPopupMode_ ? kPopupBorderImageIds

Powered by Google App Engine
This is Rietveld 408576698