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

Unified Diff: chrome/browser/themes/theme_service_mac.mm

Issue 2087893002: [cocoa] increase tab strip contrast in "Increase Contrast" mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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 side-by-side diff with in-line comments
Download patch
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;
+}

Powered by Google App Engine
This is Rietveld 408576698