summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-14 21:09:09 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-10-14 21:09:09 +0000
commit393a765581efaffca4c38b6528f5930aafe1c870 (patch)
tree182c1a1ff7da4ce5f09062dfe6b8ac2747511bb4 /chrome/browser/cocoa
parent049bb354bbbddc4f833c168818487c3195b2f060 (diff)
downloadchromium_src-393a765581efaffca4c38b6528f5930aafe1c870.zip
chromium_src-393a765581efaffca4c38b6528f5930aafe1c870.tar.gz
chromium_src-393a765581efaffca4c38b6528f5930aafe1c870.tar.bz2
Mac: colorize the "bookmarks go here" text to match the theme.
BUG=http://crbug.com/23536 TEST=as in bug Review URL: http://codereview.chromium.org/278008 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@29025 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_view.mm35
1 files changed, 35 insertions, 0 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_view.mm b/chrome/browser/cocoa/bookmark_bar_view.mm
index eb5f17b..a991e71 100644
--- a/chrome/browser/cocoa/bookmark_bar_view.mm
+++ b/chrome/browser/cocoa/bookmark_bar_view.mm
@@ -3,9 +3,44 @@
// found in the LICENSE file.
#import "chrome/browser/cocoa/bookmark_bar_view.h"
+#import "third_party/GTM/AppKit/GTMTheme.h"
+
+@interface BookmarkBarView (Private)
+- (void)themeDidChangeNotification:(NSNotification*)aNotification;
+- (void)updateTheme:(GTMTheme*)theme;
+@end
@implementation BookmarkBarView
+- (void)dealloc {
+ [[NSNotificationCenter defaultCenter] removeObserver:self];
+ [super dealloc];
+}
+
+- (void)awakeFromNib {
+ NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter];
+ [defaultCenter addObserver:self
+ selector:@selector(themeDidChangeNotification:)
+ name:kGTMThemeDidChangeNotification
+ object:nil];
+}
+
+- (void)viewDidMoveToWindow {
+ if ([self window])
+ [self updateTheme:[self gtm_theme]];
+}
+
+- (void)themeDidChangeNotification:(NSNotification*)aNotification {
+ GTMTheme* theme = [aNotification object];
+ [self updateTheme:theme];
+}
+
+- (void)updateTheme:(GTMTheme*)theme {
+ NSColor* color = [theme textColorForStyle:GTMThemeStyleBookmarksBarButton
+ state:GTMThemeStateActiveWindow];
+ [noItemTextfield_ setTextColor:color];
+}
+
// Mouse down events on the bookmark bar should not allow dragging the parent
// window around.
- (BOOL)mouseDownCanMoveWindow {