summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_view.mm
diff options
context:
space:
mode:
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];
}