diff options
Diffstat (limited to 'chrome/browser/browser_theme_provider_mac.mm')
-rw-r--r-- | chrome/browser/browser_theme_provider_mac.mm | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/chrome/browser/browser_theme_provider_mac.mm b/chrome/browser/browser_theme_provider_mac.mm index 1b88aed..65c2182 100644 --- a/chrome/browser/browser_theme_provider_mac.mm +++ b/chrome/browser/browser_theme_provider_mac.mm @@ -75,17 +75,20 @@ NSColor* BrowserThemeProvider::GetNSColor(int id) const { if (nscolor_iter != nscolor_cache_.end()) return nscolor_iter->second; - SkColor sk_color = GetColor(id); - NSColor* color = [NSColor - colorWithCalibratedRed:SkColorGetR(sk_color)/255.0 - green:SkColorGetG(sk_color)/255.0 - blue:SkColorGetB(sk_color)/255.0 - alpha:SkColorGetA(sk_color)/255.0]; - - // We loaded successfully. Cache the color. - if (color) { - nscolor_cache_[id] = [color retain]; - return color; + ColorMap::const_iterator color_iter = colors_.find(GetColorKey(id)); + if (color_iter != colors_.end()) { + const SkColor& sk_color = color_iter->second; + NSColor* color = [NSColor + colorWithCalibratedRed:SkColorGetR(sk_color)/255.0 + green:SkColorGetG(sk_color)/255.0 + blue:SkColorGetB(sk_color)/255.0 + alpha:SkColorGetA(sk_color)/255.0]; + + // We loaded successfully. Cache the color. + if (color) { + nscolor_cache_[id] = [color retain]; + return color; + } } return nil; |