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

Side by Side 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: fix 10.9 detection & themeless windows Created 4 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/themes/theme_service.h" 5 #include "chrome/browser/themes/theme_service.h"
6 6
7 #import <Cocoa/Cocoa.h> 7 #import <Cocoa/Cocoa.h>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "chrome/browser/themes/browser_theme_pack.h" 10 #include "chrome/browser/themes/browser_theme_pack.h"
11 #include "chrome/browser/themes/theme_properties.h" 11 #include "chrome/browser/themes/theme_properties.h"
12 #include "grit/theme_resources.h" 12 #include "grit/theme_resources.h"
13 #include "skia/ext/skia_utils_mac.h" 13 #include "skia/ext/skia_utils_mac.h"
14 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSColor+Luminance.h" 14 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSColor+Luminance.h"
15 #include "ui/base/material_design/material_design_controller.h" 15 #include "ui/base/material_design/material_design_controller.h"
16 #include "ui/base/resource/resource_bundle.h" 16 #include "ui/base/resource/resource_bundle.h"
17 #include "ui/gfx/color_utils.h" 17 #include "ui/gfx/color_utils.h"
18 #include "ui/gfx/image/image.h" 18 #include "ui/gfx/image/image.h"
19 19
20 @interface NSWorkspace (Redeclarations)
21
22 @property(readonly) BOOL accessibilityDisplayShouldIncreaseContrast;
23
24 @end
25
20 NSString* const kBrowserThemeDidChangeNotification = 26 NSString* const kBrowserThemeDidChangeNotification =
21 @"BrowserThemeDidChangeNotification"; 27 @"BrowserThemeDidChangeNotification";
22 28
23 typedef ThemeProperties Properties; 29 typedef ThemeProperties Properties;
24 30
25 const int kMaterialDesignIdOffset = 1000000; 31 const int kMaterialDesignIdOffset = 1000000;
26 32
27 namespace { 33 namespace {
28 34
29 void HSLToHSB(const color_utils::HSL& hsl, CGFloat* h, CGFloat* s, CGFloat* b) { 35 void HSLToHSB(const color_utils::HSL& hsl, CGFloat* h, CGFloat* s, CGFloat* b) {
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
398 return theme_service_.GetNSColor(id, incognito_); 404 return theme_service_.GetNSColor(id, incognito_);
399 } 405 }
400 406
401 NSColor* ThemeService::BrowserThemeProvider::GetNSColorTint(int id) const { 407 NSColor* ThemeService::BrowserThemeProvider::GetNSColorTint(int id) const {
402 return theme_service_.GetNSColorTint(id); 408 return theme_service_.GetNSColorTint(id);
403 } 409 }
404 410
405 NSGradient* ThemeService::BrowserThemeProvider::GetNSGradient(int id) const { 411 NSGradient* ThemeService::BrowserThemeProvider::GetNSGradient(int id) const {
406 return theme_service_.GetNSGradient(id); 412 return theme_service_.GetNSGradient(id);
407 } 413 }
414
415 bool ThemeService::BrowserThemeProvider::ShouldIncreaseContrast() const {
416 NSWorkspace* workspace = [NSWorkspace sharedWorkspace];
417 if ([workspace
418 respondsToSelector:@selector(
419 accessibilityDisplayShouldIncreaseContrast)]) {
420 return workspace.accessibilityDisplayShouldIncreaseContrast == YES;
421 }
422 return false;
423 }
OLDNEW
« no previous file with comments | « chrome/browser/themes/theme_service.h ('k') | chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698