diff options
author | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 18:01:08 +0000 |
---|---|---|
committer | erg@chromium.org <erg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-10-09 18:01:08 +0000 |
commit | 3302102a21dcdae93f17f2db57ba32ba0e8dd1da (patch) | |
tree | e8f3b5e53324e77a3dc6502a0d555e93a25261b2 /chrome/browser/browser_theme_provider_mac.mm | |
parent | 9398185452c106c0f464747fd76d70f3d212143a (diff) | |
download | chromium_src-3302102a21dcdae93f17f2db57ba32ba0e8dd1da.zip chromium_src-3302102a21dcdae93f17f2db57ba32ba0e8dd1da.tar.gz chromium_src-3302102a21dcdae93f17f2db57ba32ba0e8dd1da.tar.bz2 |
Mac: Theme the bookmark bar on the new tab page.
- XIB change: The controller has a connection to buttonView_.
- BrowserThemeProviderMac: Fix a bug where we weren't returning
default colors; we returned nil instead.
- The majority of the implementation is actually the cross platform
NtpBackgroundUtil::PaintBackgroundDetachedMode. We do platform
specific drawing on top of the background, though.
TEST=BookmarkBarToolbarViewTest.DisplayAsFloatingBarWithNoImage
TEST=BookmarkBarToolbarViewTest.DisplayAsFloatingBarWithBgImage
BUG=http://crbug.com/17625
Review URL: http://codereview.chromium.org/266027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@28560 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 | 27 |
1 files changed, 11 insertions, 16 deletions
diff --git a/chrome/browser/browser_theme_provider_mac.mm b/chrome/browser/browser_theme_provider_mac.mm index 6df0336..e27f4ae 100644 --- a/chrome/browser/browser_theme_provider_mac.mm +++ b/chrome/browser/browser_theme_provider_mac.mm @@ -75,22 +75,17 @@ NSColor* BrowserThemeProvider::GetNSColor(int id) { if (found != nscolor_cache_.end()) return found->second; - ColorMap::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; - } + 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; } return nil; |