diff options
author | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-24 01:22:15 +0000 |
---|---|---|
committer | avi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-02-24 01:22:15 +0000 |
commit | 8c3ba4d09e4d94decf1cb1759a0c58fa7459e6ef (patch) | |
tree | 678f0426ae32e7dc48c8572fa4e8d3c1cf360d80 /chrome/browser/cocoa/bookmark_bar_controller.mm | |
parent | 9492e4abf1be2910ab72f300abb7e0f28118b434 (diff) | |
download | chromium_src-8c3ba4d09e4d94decf1cb1759a0c58fa7459e6ef.zip chromium_src-8c3ba4d09e4d94decf1cb1759a0c58fa7459e6ef.tar.gz chromium_src-8c3ba4d09e4d94decf1cb1759a0c58fa7459e6ef.tar.bz2 |
Next batch of changes to kill GTMTheme.
BUG=http://crbug.com/35554
TEST=no visible change in normal mode; incognito mode still being worked on
Review URL: http://codereview.chromium.org/652179
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@39825 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_controller.mm')
-rw-r--r-- | chrome/browser/cocoa/bookmark_bar_controller.mm | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_controller.mm b/chrome/browser/cocoa/bookmark_bar_controller.mm index f2a5687..adb6e13 100644 --- a/chrome/browser/cocoa/bookmark_bar_controller.mm +++ b/chrome/browser/cocoa/bookmark_bar_controller.mm @@ -10,7 +10,7 @@ #include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/browser.h" #include "chrome/browser/browser_list.h" -#include "chrome/browser/browser_theme_provider.h" +#import "chrome/browser/browser_theme_provider.h" #import "chrome/browser/cocoa/background_gradient_view.h" #import "chrome/browser/cocoa/bookmark_bar_bridge.h" #import "chrome/browser/cocoa/bookmark_bar_constants.h" @@ -25,6 +25,7 @@ #import "chrome/browser/cocoa/bookmark_name_folder_controller.h" #import "chrome/browser/cocoa/event_utils.h" #import "chrome/browser/cocoa/menu_button.h" +#import "chrome/browser/cocoa/themed_window.h" #import "chrome/browser/cocoa/toolbar_controller.h" #import "chrome/browser/cocoa/view_resizer.h" #include "chrome/browser/metrics/user_metrics.h" @@ -203,7 +204,7 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter]; [defaultCenter addObserver:self selector:@selector(themeDidChangeNotification:) - name:kGTMThemeDidChangeNotification + name:kBrowserThemeDidChangeNotification object:nil]; // This call triggers an awakeFromNib, which builds the bar, which @@ -241,11 +242,12 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; // because our trigger is an [NSView viewWillMoveToWindow:], which the // controller doesn't normally know about. Otherwise we don't have // access to the theme before we know what window we will be on. -- (void)updateTheme:(GTMTheme*)theme { - if (!theme) +- (void)updateTheme:(ThemeProvider*)themeProvider { + if (!themeProvider) return; - NSColor* color = [theme textColorForStyle:GTMThemeStyleBookmarksBarButton - state:GTMThemeStateActiveWindow]; + NSColor* color = + themeProvider->GetNSColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT, + true); for (BookmarkButton* button in buttons_.get()) { BookmarkButtonCell* cell = [button cell]; [cell setTextColor:color]; @@ -255,8 +257,9 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; // 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]; } - (void)awakeFromNib { @@ -1210,7 +1213,7 @@ const NSTimeInterval kBookmarkBarAnimationDuration = 0.12; [self clearBookmarkBar]; [self addNodesToButtonList:node]; [self createOtherBookmarksButton]; - [self updateTheme:[[self view] gtm_theme]]; + [self updateTheme:[[[self view] window] themeProvider]]; [self resizeButtons]; [self positionOffTheSideButton]; [self addNonBookmarkButtonsToView]; |