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

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

Issue 2710003003: omnibox: use dark border stroke in Increase Contrast mode (Closed)
Patch Set: Created 3 years, 10 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 | « no previous file | 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/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 f7b55825e0ed2cc0bf6c4327197ceacec888c2cf..7f5cd2442f2c486a2f5453b72077693e29682d34 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
@@ -361,12 +361,20 @@ - (void)drawWithFrame:(NSRect)frame inView:(NSView*)controlView {
}
// Draw the border.
+ const ui::ThemeProvider* provider = [[controlView window] themeProvider];
+ bool increaseContrast = provider && provider->ShouldIncreaseContrast();
if (!inDarkMode) {
const CGFloat kNormalStrokeGray = 168 / 255.;
Mark Mentovai 2017/02/23 01:57:28 Scope tightly to where it’s used, inside the else
Elly Fong-Jones 2017/02/23 17:32:16 Done.
- [[NSColor colorWithCalibratedWhite:kNormalStrokeGray alpha:1] set];
+ if (increaseContrast)
+ [[NSColor blackColor] set];
+ else
+ [[NSColor colorWithCalibratedWhite:kNormalStrokeGray alpha:1] set];
} else {
const CGFloat k30PercentAlpha = 0.3;
Mark Mentovai 2017/02/23 01:57:28 Me too.
Elly Fong-Jones 2017/02/23 17:32:16 Done.
- [[NSColor colorWithCalibratedWhite:0 alpha:k30PercentAlpha] set];
+ if (increaseContrast)
+ [[NSColor whiteColor] set];
+ else
+ [[NSColor colorWithCalibratedWhite:0 alpha:k30PercentAlpha] set];
}
Mark Mentovai 2017/02/23 01:57:28 Not required, but consider factoring the -set out
Elly Fong-Jones 2017/02/23 17:32:16 I thought about doing this but I don't think it's
[path stroke];
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698