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

Side by Side Diff: chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm

Issue 2265423007: [Material][Mac] Fix for bubble decoration text in dark theme (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabs/tab_window_controller.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <cmath> 5 #include <cmath>
6 6
7 #import "chrome/browser/ui/cocoa/location_bar/bubble_decoration.h" 7 #import "chrome/browser/ui/cocoa/location_bar/bubble_decoration.h"
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/foundation_util.h" 10 #include "base/mac/foundation_util.h"
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 116
117 // Draw the divider and set the text color. 117 // Draw the divider and set the text color.
118 if (ui::MaterialDesignController::IsModeMaterial()) { 118 if (ui::MaterialDesignController::IsModeMaterial()) {
119 NSBezierPath* line = [NSBezierPath bezierPath]; 119 NSBezierPath* line = [NSBezierPath bezierPath];
120 [line setLineWidth:1]; 120 [line setLineWidth:1];
121 [line moveToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(), 121 [line moveToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(),
122 NSMinY(decoration_frame))]; 122 NSMinY(decoration_frame))];
123 [line lineToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(), 123 [line lineToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(),
124 NSMaxY(decoration_frame))]; 124 NSMaxY(decoration_frame))];
125 125
126 bool in_dark_mode = [[control_view window] hasDarkTheme]; 126 bool in_dark_mode = [[control_view window] inIncognitoModeWithSystemTheme];
127 [GetDividerColor(in_dark_mode) set]; 127 [GetDividerColor(in_dark_mode) set];
128 [line stroke]; 128 [line stroke];
129 129
130 NSColor* text_color = 130 NSColor* text_color =
131 in_dark_mode ? GetDarkModeTextColor() : GetBackgroundBorderColor(); 131 in_dark_mode ? GetDarkModeTextColor() : GetBackgroundBorderColor();
132 SetTextColor(text_color); 132 SetTextColor(text_color);
133 } 133 }
134 134
135 if (label_) { 135 if (label_) {
136 NSRect text_rect = frame; 136 NSRect text_rect = frame;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
186 [attributes_ setObject:text_color forKey:NSForegroundColorAttributeName]; 186 [attributes_ setObject:text_color forKey:NSForegroundColorAttributeName];
187 } 187 }
188 188
189 void BubbleDecoration::SetFont(NSFont* font) { 189 void BubbleDecoration::SetFont(NSFont* font) {
190 [attributes_ setObject:font forKey:NSFontAttributeName]; 190 [attributes_ setObject:font forKey:NSFontAttributeName];
191 } 191 }
192 192
193 void BubbleDecoration::SetRetinaBaselineOffset(CGFloat offset) { 193 void BubbleDecoration::SetRetinaBaselineOffset(CGFloat offset) {
194 retina_baseline_offset_ = offset; 194 retina_baseline_offset_ = offset;
195 } 195 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/tabs/tab_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698