OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/native_theme/native_theme_mac.h" | 5 #include "ui/native_theme/native_theme_mac.h" |
6 | 6 |
7 #import <Cocoa/Cocoa.h> | 7 #import <Cocoa/Cocoa.h> |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 | 9 |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
174 return SK_ColorWHITE; | 174 return SK_ColorWHITE; |
175 | 175 |
176 case kColorId_FocusedBorderColor: | 176 case kColorId_FocusedBorderColor: |
177 return NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]); | 177 return NSSystemColorToSkColor([NSColor keyboardFocusIndicatorColor]); |
178 case kColorId_UnfocusedBorderColor: | 178 case kColorId_UnfocusedBorderColor: |
179 return NSSystemColorToSkColor([NSColor controlColor]); | 179 return NSSystemColorToSkColor([NSColor controlColor]); |
180 | 180 |
181 // Buttons and labels. | 181 // Buttons and labels. |
182 case kColorId_ButtonEnabledColor: | 182 case kColorId_ButtonEnabledColor: |
183 case kColorId_LabelEnabledColor: | 183 case kColorId_LabelEnabledColor: |
| 184 return NSSystemColorToSkColor([NSColor controlTextColor]); |
| 185 // NSColor doesn't offer a color for prominent buttons. Use the Aura color, |
| 186 // but apply the system tint. This is a good match for the blue Cocoa uses |
| 187 // to draw buttons that are given a \n key equivalent. |
184 case kColorId_ProminentButtonColor: | 188 case kColorId_ProminentButtonColor: |
185 return NSSystemColorToSkColor([NSColor controlTextColor]); | 189 return ApplySystemControlTint(GetAuraColor(color_id, this)); |
186 case kColorId_ButtonDisabledColor: | 190 case kColorId_ButtonDisabledColor: |
187 case kColorId_LabelDisabledColor: | 191 case kColorId_LabelDisabledColor: |
188 return NSSystemColorToSkColor([NSColor disabledControlTextColor]); | 192 return NSSystemColorToSkColor([NSColor disabledControlTextColor]); |
189 case kColorId_ButtonHoverColor: | 193 case kColorId_ButtonHoverColor: |
190 return NSSystemColorToSkColor([NSColor selectedControlTextColor]); | 194 return NSSystemColorToSkColor([NSColor selectedControlTextColor]); |
191 case kColorId_LabelTextSelectionColor: | 195 case kColorId_LabelTextSelectionColor: |
192 return NSSystemColorToSkColor([NSColor selectedTextColor]); | 196 return NSSystemColorToSkColor([NSColor selectedTextColor]); |
193 | 197 |
194 // Link. | 198 // Link. |
195 case kColorId_LinkDisabled: | 199 case kColorId_LinkDisabled: |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
279 } | 283 } |
280 } | 284 } |
281 | 285 |
282 NativeThemeMac::NativeThemeMac() { | 286 NativeThemeMac::NativeThemeMac() { |
283 } | 287 } |
284 | 288 |
285 NativeThemeMac::~NativeThemeMac() { | 289 NativeThemeMac::~NativeThemeMac() { |
286 } | 290 } |
287 | 291 |
288 } // namespace ui | 292 } // namespace ui |
OLD | NEW |