OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/browser_theme_provider.h" | 5 #include "chrome/browser/themes/browser_theme_provider.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 "gfx/color_utils.h" | |
12 #include "skia/ext/skia_utils_mac.h" | 11 #include "skia/ext/skia_utils_mac.h" |
13 #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" | 12 #import "third_party/GTM/AppKit/GTMNSColor+Luminance.h" |
| 13 #include "ui/gfx/color_utils.h" |
14 | 14 |
15 NSString* const kBrowserThemeDidChangeNotification = | 15 NSString* const kBrowserThemeDidChangeNotification = |
16 @"BrowserThemeDidChangeNotification"; | 16 @"BrowserThemeDidChangeNotification"; |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 void HSLToHSB(const color_utils::HSL& hsl, CGFloat* h, CGFloat* s, CGFloat* b) { | 20 void HSLToHSB(const color_utils::HSL& hsl, CGFloat* h, CGFloat* s, CGFloat* b) { |
21 SkColor color = color_utils::HSLToSkColor(hsl, 255); // alpha doesn't matter | 21 SkColor color = color_utils::HSLToSkColor(hsl, 255); // alpha doesn't matter |
22 SkScalar hsv[3]; | 22 SkScalar hsv[3]; |
23 SkColorToHSV(color, hsv); | 23 SkColorToHSV(color, hsv); |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
308 } | 308 } |
309 nscolor_cache_.clear(); | 309 nscolor_cache_.clear(); |
310 | 310 |
311 // Free gradients. | 311 // Free gradients. |
312 for (NSGradientMap::iterator i = nsgradient_cache_.begin(); | 312 for (NSGradientMap::iterator i = nsgradient_cache_.begin(); |
313 i != nsgradient_cache_.end(); i++) { | 313 i != nsgradient_cache_.end(); i++) { |
314 [i->second release]; | 314 [i->second release]; |
315 } | 315 } |
316 nsgradient_cache_.clear(); | 316 nsgradient_cache_.clear(); |
317 } | 317 } |
OLD | NEW |