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/cocoa | |
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/cocoa')
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_toolbar_view.mm | 23 |
1 files changed, 15 insertions, 8 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm b/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm index 433f30f..56fb632 100644 --- a/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm +++ b/chrome/browser/cocoa/bookmark_bar_toolbar_view.mm @@ -54,11 +54,6 @@ const CGFloat kBorderRadius = 3.0; } } -@end - - -@implementation BookmarkBarToolbarView (Private) - - (void)drawRectAsFloating:(NSRect)rect { NSRect bounds = [self bounds]; @@ -86,15 +81,27 @@ const CGFloat kBorderRadius = 3.0; bookmarks::kNTPBookmarkBarPadding, NSWidth(bounds) - 2 * bookmarks::kNTPBookmarkBarPadding, NSHeight(bounds) - 2 * bookmarks::kNTPBookmarkBarPadding); - // Now draw a beizer path with rounded rectangles around the area + // Now draw a bezier path with rounded rectangles around the area NSBezierPath* border = [NSBezierPath bezierPathWithRoundedRect:frame_rect xRadius:kBorderRadius yRadius:kBorderRadius]; - [themeProvider->GetNSColor(BrowserThemeProvider::COLOR_TOOLBAR) set];; + NSColor* toolbarColor = + [[self gtm_theme] backgroundColorForStyle:GTMThemeStyleToolBar + state:GTMThemeStateActiveWindow]; + // workaround for default theme + // TODO(alcor) next GTM update return nil for background color if not set; + if ([toolbarColor isEqual:[NSColor colorWithCalibratedWhite:0.5 alpha:1.0]]) + toolbarColor = nil; + if (!toolbarColor) + toolbarColor = [NSColor colorWithCalibratedWhite:0.9 alpha:1.0]; + [toolbarColor set]; [border fill]; - [themeProvider->GetNSColor(BrowserThemeProvider::COLOR_NTP_HEADER) set]; + NSColor* borderColor = + [[self gtm_theme] strokeColorForStyle:GTMThemeStyleToolBar + state:GTMThemeStateActiveWindow]; + [borderColor set]; [border stroke]; [theContext restoreGraphicsState]; |