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

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

Issue 2032143004: [Mac][Material Design] Bring Omnibox stroke and MD colors up to spec. (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
Index: chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
index 7bdd563e1a2d4fc05c0886bf054690ea4f26ae8e..99f806d83e488e86120ab3a5b3b9b71a65894451 100644
--- a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
@@ -100,6 +100,26 @@ void BubbleDecoration::DrawInFrame(NSRect frame, NSView* control_view) {
textOffset = NSMaxX(imageRect) + kIconLabelPadding;
}
+ // Draw the divider and set the text color.
+ if (ui::MaterialDesignController::IsModeMaterial()) {
+ NSBezierPath* line = [NSBezierPath bezierPath];
+ [line setLineWidth:1];
+ [line moveToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(),
+ NSMinY(decoration_frame))];
+ [line lineToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(),
+ NSMaxY(decoration_frame))];
+
+ bool in_dark_mode = [[control_view window] inIncognitoModeWithSystemTheme];
+ [GetDividerColor(in_dark_mode) set];
+ [line stroke];
+
+ NSColor* text_color =
+ in_dark_mode
+ ? skia::SkColorToSRGBNSColor(kMaterialDarkModeTextColor)
+ : GetBackgroundBorderColor();
+ SetTextColor(text_color);
+ }
+
if (label_) {
NSRect textRect = frame;
textRect.origin.x = textOffset;

Powered by Google App Engine
This is Rietveld 408576698