Chromium Code Reviews| Index: chrome/browser/themes/theme_service_mac.mm |
| diff --git a/chrome/browser/themes/theme_service_mac.mm b/chrome/browser/themes/theme_service_mac.mm |
| index a5654b94eff35a438fc1f8dfdb8cf49d10a3d705..8b89f8073d63d9965024a32cc3ecc8139e160280 100644 |
| --- a/chrome/browser/themes/theme_service_mac.mm |
| +++ b/chrome/browser/themes/theme_service_mac.mm |
| @@ -7,6 +7,7 @@ |
| #import <Cocoa/Cocoa.h> |
| #include "base/logging.h" |
| +#include "base/mac/mac_util.h" |
| #include "chrome/browser/themes/browser_theme_pack.h" |
| #include "chrome/browser/themes/theme_properties.h" |
| #include "grit/theme_resources.h" |
| @@ -17,6 +18,12 @@ |
| #include "ui/gfx/color_utils.h" |
| #include "ui/gfx/image/image.h" |
| +@interface NSWorkspace (Redeclarations) |
| + |
| +@property(readonly) BOOL accessibilityDisplayShouldIncreaseContrast; |
| + |
| +@end |
| + |
| NSString* const kBrowserThemeDidChangeNotification = |
| @"BrowserThemeDidChangeNotification"; |
| @@ -405,3 +412,10 @@ NSColor* ThemeService::BrowserThemeProvider::GetNSColorTint(int id) const { |
| NSGradient* ThemeService::BrowserThemeProvider::GetNSGradient(int id) const { |
| return theme_service_.GetNSGradient(id); |
| } |
| + |
| +bool ThemeService::BrowserThemeProvider::ShouldIncreaseContrast() const { |
| + NSWorkspace* workspace = [NSWorkspace sharedWorkspace]; |
| + if (base::mac::IsOSYosemiteOrLater()) |
|
Mark Mentovai
2016/06/21 19:58:54
Wouldn’t our usual style be to use -respondsToSele
Elly Fong-Jones
2016/06/21 20:25:36
Done.
|
| + return workspace.accessibilityDisplayShouldIncreaseContrast == YES; |
| + return false; |
| +} |