summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bubble_view.mm
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-23 18:36:12 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-23 18:36:12 +0000
commit53ee4e180c8481c8054e5f8997376f1c79544b1f (patch)
tree0e87181b12dc6777aa26533cbc6716ce3409cff1 /chrome/browser/cocoa/bubble_view.mm
parenta05c2ef0084fecfdfe297abeb2a6268b73abfce5 (diff)
downloadchromium_src-53ee4e180c8481c8054e5f8997376f1c79544b1f.zip
chromium_src-53ee4e180c8481c8054e5f8997376f1c79544b1f.tar.gz
chromium_src-53ee4e180c8481c8054e5f8997376f1c79544b1f.tar.bz2
Another pass at removal of GTMTheme. Also fixes unreadability of bookmark bar/status bubble in unthemed incognito mode.
BUG=http://crbug.com/35554 ; http://crbug.com/29845 TEST=no visible change in normal mode; themed incognito windows should look ugly still but in a different way Review URL: http://codereview.chromium.org/650092 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39749 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bubble_view.mm')
-rw-r--r--chrome/browser/cocoa/bubble_view.mm35
1 files changed, 9 insertions, 26 deletions
diff --git a/chrome/browser/cocoa/bubble_view.mm b/chrome/browser/cocoa/bubble_view.mm
index 515b9a5..685f3bc 100644
--- a/chrome/browser/cocoa/bubble_view.mm
+++ b/chrome/browser/cocoa/bubble_view.mm
@@ -4,7 +4,8 @@
#import "chrome/browser/cocoa/bubble_view.h"
-#import "chrome/browser/cocoa/GTMTheme.h"
+#include "chrome/browser/browser_theme_provider.h"
+#import "chrome/browser/cocoa/themed_window.h"
#import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h"
#import "third_party/GTM/AppKit/GTMNSColor+Luminance.h"
@@ -51,16 +52,6 @@ const float kWindowEdge = 0.7f;
return [NSFont systemFontOfSize:[NSFont smallSystemFontSize]];
}
-// Asks the given theme provider for its theme. If there isn't one specified,
-// check the window we are in. May still return nil if the window doesn't
-// support themeing.
-- (GTMTheme*)gtm_theme {
- GTMTheme* theme = [themeProvider_ gtm_theme];
- if (!theme)
- theme = [[self window] gtm_theme];
- return theme;
-}
-
// Draws the themed background and the text. Will draw a gray bg if no theme.
- (void)drawRect:(NSRect)rect {
float topLeftRadius =
@@ -72,7 +63,7 @@ const float kWindowEdge = 0.7f;
float bottomRightRadius =
cornerFlags_ & kRoundedBottomRightCorner ? kBubbleCornerRadius : 0;
- GTMTheme* theme = [self gtm_theme];
+ ThemeProvider* themeProvider = [themeProvider_ themeProvider];
// Background / Edge
@@ -85,26 +76,18 @@ const float kWindowEdge = 0.7f;
bottomLeftCornerRadius:bottomLeftRadius
bottomRightCornerRadius:bottomRightRadius];
- NSColor* color =
- [theme backgroundColorForStyle:GTMThemeStyleToolBar
- state:GTMThemeStateActiveWindow];
-
- // workaround for default theme
- // TODO(alcor) next GTM update return nil for background color if not set;
- // http://crbug.com/25196
- if ([color isEqual:[NSColor colorWithCalibratedWhite:0.5 alpha:1.0]])
- color = nil;
- if (!color)
- color = [NSColor colorWithCalibratedWhite:0.9 alpha:1.0];
- [color set];
+ if (themeProvider)
+ [themeProvider->GetNSColor(BrowserThemeProvider::COLOR_TOOLBAR, true) set];
[border fill];
[[NSColor colorWithDeviceWhite:kWindowEdge alpha:1.0f] set];
[border stroke];
// Text
- NSColor* textColor = [theme textColorForStyle:GTMThemeStyleTabBarSelected
- state:GTMThemeStateActiveWindow];
+ NSColor* textColor = [NSColor blackColor];
+ if (themeProvider)
+ textColor = themeProvider->GetNSColor(BrowserThemeProvider::COLOR_TAB_TEXT,
+ true);
NSFont* textFont = [self font];
scoped_nsobject<NSShadow> textShadow([[NSShadow alloc] init]);
[textShadow setShadowBlurRadius:0.0f];