| OLD | NEW |
| 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 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 // Draw the divider and set the text color. | 113 // Draw the divider and set the text color. |
| 114 if (ui::MaterialDesignController::IsModeMaterial()) { | 114 if (ui::MaterialDesignController::IsModeMaterial()) { |
| 115 NSBezierPath* line = [NSBezierPath bezierPath]; | 115 NSBezierPath* line = [NSBezierPath bezierPath]; |
| 116 [line setLineWidth:1]; | 116 [line setLineWidth:1]; |
| 117 [line moveToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(), | 117 [line moveToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(), |
| 118 NSMinY(decoration_frame))]; | 118 NSMinY(decoration_frame))]; |
| 119 [line lineToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(), | 119 [line lineToPoint:NSMakePoint(NSMaxX(decoration_frame) - DividerPadding(), |
| 120 NSMaxY(decoration_frame))]; | 120 NSMaxY(decoration_frame))]; |
| 121 | 121 |
| 122 bool in_dark_mode = [[control_view window] inIncognitoModeWithSystemTheme]; | 122 bool in_dark_mode = [[control_view window] hasDarkTheme]; |
| 123 [GetDividerColor(in_dark_mode) set]; | 123 [GetDividerColor(in_dark_mode) set]; |
| 124 [line stroke]; | 124 [line stroke]; |
| 125 | 125 |
| 126 NSColor* text_color = | 126 NSColor* text_color = |
| 127 in_dark_mode | 127 in_dark_mode |
| 128 ? skia::SkColorToSRGBNSColor(kMaterialDarkModeTextColor) | 128 ? skia::SkColorToSRGBNSColor(kMaterialDarkModeTextColor) |
| 129 : GetBackgroundBorderColor(); | 129 : GetBackgroundBorderColor(); |
| 130 SetTextColor(text_color); | 130 SetTextColor(text_color); |
| 131 } | 131 } |
| 132 | 132 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 184 [attributes_ setObject:text_color forKey:NSForegroundColorAttributeName]; | 184 [attributes_ setObject:text_color forKey:NSForegroundColorAttributeName]; |
| 185 } | 185 } |
| 186 | 186 |
| 187 void BubbleDecoration::SetFont(NSFont* font) { | 187 void BubbleDecoration::SetFont(NSFont* font) { |
| 188 [attributes_ setObject:font forKey:NSFontAttributeName]; | 188 [attributes_ setObject:font forKey:NSFontAttributeName]; |
| 189 } | 189 } |
| 190 | 190 |
| 191 void BubbleDecoration::SetRetinaBaselineOffset(CGFloat offset) { | 191 void BubbleDecoration::SetRetinaBaselineOffset(CGFloat offset) { |
| 192 retina_baseline_offset_ = offset; | 192 retina_baseline_offset_ = offset; |
| 193 } | 193 } |
| OLD | NEW |