| 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 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |