diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 14:13:35 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-16 14:13:35 +0000 |
commit | 0564b9a64eae26351f40e00fb68d47e398141f92 (patch) | |
tree | 77d4bd01b549b0e0e32f55727f287618a09e7e0a /chrome/browser/browser_theme_provider_mac.mm | |
parent | 61dd4fcdbb69e8fa9b93f6b6a9d571ee5dd135ea (diff) | |
download | chromium_src-0564b9a64eae26351f40e00fb68d47e398141f92.zip chromium_src-0564b9a64eae26351f40e00fb68d47e398141f92.tar.gz chromium_src-0564b9a64eae26351f40e00fb68d47e398141f92.tar.bz2 |
Fix Mac theme provider so it returns nil when there is no theme provided color. Partial revert of r28560.
BUG=http://crbug.com/24551
TEST=as in bug
Review URL: http://codereview.chromium.org/274069
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29269 0039d316-1c4b-4281-b951-d872f2087c98
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; |