summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/bookmark_bar_folder_controller.mm
diff options
context:
space:
mode:
authormrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-30 17:24:00 +0000
committermrossetti@chromium.org <mrossetti@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-03-30 17:24:00 +0000
commit99afaa77ff54c0ce39b6e3032a362aeade8aac4f (patch)
treebe480bc954d52396408fec468f01766786a2ecab /chrome/browser/cocoa/bookmark_bar_folder_controller.mm
parentd0af0e41aa9f536bc9bc47872117eb65979cd015 (diff)
downloadchromium_src-99afaa77ff54c0ce39b6e3032a362aeade8aac4f.zip
chromium_src-99afaa77ff54c0ce39b6e3032a362aeade8aac4f.tar.gz
chromium_src-99afaa77ff54c0ce39b6e3032a362aeade8aac4f.tar.bz2
Revert 43041 - Remove the themeing from the folder menu background, text in the folder menu items, and no longer needed calls.
I found an easier, simpler change. BUG=39428 TEST=Pop up a folder menu and insure that the background does not adopt any theme settings. Review URL: http://codereview.chromium.org/1548003 TBR=mrossetti@chromium.org Review URL: http://codereview.chromium.org/1596001 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43096 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/bookmark_bar_folder_controller.mm')
-rw-r--r--chrome/browser/cocoa/bookmark_bar_folder_controller.mm30
1 files changed, 29 insertions, 1 deletions
diff --git a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm
index c525e88..c334ff8 100644
--- a/chrome/browser/cocoa/bookmark_bar_folder_controller.mm
+++ b/chrome/browser/cocoa/bookmark_bar_folder_controller.mm
@@ -49,6 +49,14 @@ const CGFloat kBookmarkBarFolderScrollAmount =
parentController_.reset([controller retain]);
buttons_.reset([[NSMutableArray alloc] init]);
folderTarget_.reset([[BookmarkFolderTarget alloc] initWithController:self]);
+
+ // Register for theme changes.
+ NSNotificationCenter* defaultCenter = [NSNotificationCenter defaultCenter];
+ [defaultCenter addObserver:self
+ selector:@selector(themeDidChangeNotification:)
+ name:kBrowserThemeDidChangeNotification
+ object:nil];
+
[self configureWindow];
[self addScrollTracking];
}
@@ -73,6 +81,26 @@ const CGFloat kBookmarkBarFolderScrollAmount =
[super showWindow:sender];
}
+// Update theme information for all our buttons.
+- (void)updateTheme:(ThemeProvider*)themeProvider {
+ if (!themeProvider)
+ return;
+ NSColor* color =
+ themeProvider->GetNSColor(BrowserThemeProvider::COLOR_BOOKMARK_TEXT,
+ true);
+ for (BookmarkButton* button in buttons_.get()) {
+ BookmarkButtonCell* cell = [button cell];
+ [cell setTextColor:color];
+ }
+}
+
+// Called after the current theme has changed.
+- (void)themeDidChangeNotification:(NSNotification*)aNotification {
+ ThemeProvider* themeProvider =
+ static_cast<ThemeProvider*>([[aNotification object] pointerValue]);
+ [self updateTheme:themeProvider];
+}
+
// Redirect bookmark button cell creation to our parent to allow a
// single implementation.
- (NSCell*)cellForBookmarkNode:(const BookmarkNode*)child {
@@ -239,6 +267,7 @@ const CGFloat kBookmarkBarFolderScrollAmount =
buttonsOuterFrame.origin.y -= bookmarks::kBookmarkBarHeight;
}
}
+ [self updateTheme:[self themeProvider]];
// Now that we have all our buttons we can determine the real size
// of our window.
@@ -386,7 +415,6 @@ const CGFloat kBookmarkBarFolderScrollAmount =
}
- (ThemeProvider*)themeProvider {
- // Note that the theme is ignored for the menu and its buttons.
return [parentController_ themeProvider];
}