OLD | NEW |
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 "skia/ext/skia_utils_mac.h" | 12 #include "skia/ext/skia_utils_mac.h" |
13 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSColor+Luminance.h" | 13 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSColor+Luminance.h" |
14 #include "ui/base/resource/resource_bundle.h" | 14 #include "ui/base/resource/resource_bundle.h" |
15 #include "ui/gfx/color_utils.h" | 15 #include "ui/gfx/color_utils.h" |
16 #include "ui/gfx/image/image.h" | 16 #include "ui/gfx/image/image.h" |
17 #include "skia/ext/skia_utils_mac.h" | |
18 | 17 |
19 NSString* const kBrowserThemeDidChangeNotification = | 18 NSString* const kBrowserThemeDidChangeNotification = |
20 @"BrowserThemeDidChangeNotification"; | 19 @"BrowserThemeDidChangeNotification"; |
21 | 20 |
22 typedef ThemeProperties Properties; | 21 typedef ThemeProperties Properties; |
23 | 22 |
24 namespace { | 23 namespace { |
25 | 24 |
26 void HSLToHSB(const color_utils::HSL& hsl, CGFloat* h, CGFloat* s, CGFloat* b) { | 25 void HSLToHSB(const color_utils::HSL& hsl, CGFloat* h, CGFloat* s, CGFloat* b) { |
27 SkColor color = color_utils::HSLToSkColor(hsl, 255); // alpha doesn't matter | 26 SkColor color = color_utils::HSLToSkColor(hsl, 255); // alpha doesn't matter |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
280 } | 279 } |
281 nscolor_cache_.clear(); | 280 nscolor_cache_.clear(); |
282 | 281 |
283 // Free gradients. | 282 // Free gradients. |
284 for (NSGradientMap::iterator i = nsgradient_cache_.begin(); | 283 for (NSGradientMap::iterator i = nsgradient_cache_.begin(); |
285 i != nsgradient_cache_.end(); i++) { | 284 i != nsgradient_cache_.end(); i++) { |
286 [i->second release]; | 285 [i->second release]; |
287 } | 286 } |
288 nsgradient_cache_.clear(); | 287 nsgradient_cache_.clear(); |
289 } | 288 } |
OLD | NEW |