summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_view.mm
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-24 01:49:00 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-24 01:49:00 +0000
commit1ddc110cf3e4f6027c5ecd1fe1f52cefde79d9dd (patch)
treed16d2eeef46367f782cc9d6baa05ebdc0747821d /chrome/browser/cocoa/bookmark_bar_view.mm
parent70082aabee6372122bf5a0c5ac68bed55315abc0 (diff)
downloadchromium_src-1ddc110cf3e4f6027c5ecd1fe1f52cefde79d9dd.zip
chromium_src-1ddc110cf3e4f6027c5ecd1fe1f52cefde79d9dd.tar.gz
chromium_src-1ddc110cf3e4f6027c5ecd1fe1f52cefde79d9dd.tar.bz2
Reverting the revert, reinstating 39825. FindBarTextFieldCellTest.FocusedDisplay is flaky.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39834 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_view.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_view.mm32
1 files changed, 19 insertions, 13 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_view.mm b/chrome/browser/cocoa/bookmark_bar_view.mm
index ae8ca8c..96b7594 100644
--- a/chrome/browser/cocoa/bookmark_bar_view.mm
+++ b/chrome/browser/cocoa/bookmark_bar_view.mm
@@ -4,14 +4,15 @@
#import "chrome/browser/cocoa/bookmark_bar_view.h"
+#import "chrome/browser/browser_theme_provider.h"
#import "chrome/browser/cocoa/bookmark_bar_controller.h"
#import "chrome/browser/cocoa/bookmark_button.h"
-#import "chrome/browser/cocoa/GTMTheme.h"
+#import "chrome/browser/cocoa/themed_window.h"
#import "third_party/mozilla/include/NSPasteboard+Utils.h"
@interface BookmarkBarView (Private)
- (void)themeDidChangeNotification:(NSNotification*)aNotification;
-- (void)updateTheme:(GTMTheme*)theme;
+- (void)updateTheme:(ThemeProvider*)themeProvider;
@end
@implementation BookmarkBarView
@@ -27,7 +28,7 @@
NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter];
[defaultCenter addObserver:self
selector:@selector(themeDidChangeNotification:)
- name:kGTMThemeDidChangeNotification
+ name:kBrowserThemeDidChangeNotification
object:nil];
DCHECK(controller_ && "Expected this to be hooked up via Interface Builder");
@@ -44,21 +45,27 @@
// controller desn't have access to it until it's placed in the view
// hierarchy. This is the spot where we close the loop.
- (void)viewWillMoveToWindow:(NSWindow*)window {
- [self updateTheme:[window gtm_theme]];
- [controller_ updateTheme:[window gtm_theme]];
+ ThemeProvider* themeProvider = [window themeProvider];
+ [self updateTheme:themeProvider];
+ [controller_ updateTheme:themeProvider];
}
// Called after the current theme has changed.
- (void)themeDidChangeNotification:(NSNotification*)aNotification {
- GTMTheme* theme = [aNotification object];
- [self updateTheme:theme];
+ ThemeProvider* themeProvider =
+ static_cast<ThemeProvider*>([[aNotification object] pointerValue]);
+ [self updateTheme:themeProvider];
}
// Adapt appearance to the current theme. Called after theme changes and before
// this is shown for the first time.
-- (void)updateTheme:(GTMTheme*)theme {
- NSColor* color = [theme textColorForStyle:GTMThemeStyleBookmarksBarButton
- state:GTMThemeStateActiveWindow];
+- (void)updateTheme:(ThemeProvider*)themeProvider {
+ if (!themeProvider)
+ return;
+
+ NSColor* color =
+ themeProvider->GetNSColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT,
+ true);
[noItemTextfield_ setTextColor:color];
}
@@ -88,9 +95,8 @@
NSRect uglyBlackBar =
NSMakeRect(xLeft, kBarVertPad,
kBarWidth, NSHeight([self bounds]) - 2 * kBarVertPad);
- NSColor* uglyBlackBarColor =
- [[self gtm_theme] textColorForStyle:GTMThemeStyleBookmarksBarButton
- state:GTMThemeStateActiveWindow];
+ NSColor* uglyBlackBarColor = [[self window] themeProvider]->
+ GetNSColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT, true);
[[uglyBlackBarColor colorWithAlphaComponent:kBarOpacity] setFill];
[[NSBezierPath bezierPathWithRect:uglyBlackBar] fill];
}