summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cocoa/hyperlink_button_cell.mm
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-09 16:13:11 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-09 16:13:11 +0000
commit2898901f661d287c78aa25f68b9c6465038884aa (patch)
treec354851cca7d6e6943eed962545a21fe7fddb2b3 /chrome/browser/cocoa/hyperlink_button_cell.mm
parent269ab28cc179018f1e050b3d3332c2007c30422f (diff)
downloadchromium_src-2898901f661d287c78aa25f68b9c6465038884aa.zip
chromium_src-2898901f661d287c78aa25f68b9c6465038884aa.tar.gz
chromium_src-2898901f661d287c78aa25f68b9c6465038884aa.tar.bz2
Mac: Theme "Show all downloads..." link.
Refactor HyperlinkCell a bit and make it less crashy. This depends on http://codereview.chromium.org/377026 (the changes form that CL are contained in this CL too. Ignore them.) BUG=none TEST=Install theme, "Show all downloads..." color should change. Uninstall theme through installing the "classic" theme in the gallery, link should be blue again. Hit "Reset to default theme" in prefs, theme should still be blue. Open and close shelf a few times and change themes, nothing should crash. Review URL: http://codereview.chromium.org/371059 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@31429 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cocoa/hyperlink_button_cell.mm')
-rw-r--r--chrome/browser/cocoa/hyperlink_button_cell.mm8
1 files changed, 6 insertions, 2 deletions
diff --git a/chrome/browser/cocoa/hyperlink_button_cell.mm b/chrome/browser/cocoa/hyperlink_button_cell.mm
index 8493a8c..ceaea3f 100644
--- a/chrome/browser/cocoa/hyperlink_button_cell.mm
+++ b/chrome/browser/cocoa/hyperlink_button_cell.mm
@@ -12,6 +12,10 @@
@implementation HyperlinkButtonCell
@dynamic textColor;
++ (NSColor*)defaultTextColor {
+ return [NSColor blueColor];
+}
+
// Designated initializer.
- (id)init {
if ((self = [super init])) {
@@ -40,7 +44,7 @@
// common cell customization code.
- (void)customizeButtonCell {
[self setBordered:NO];
- [self setTextColor:[NSColor blueColor]];
+ [self setTextColor:[HyperlinkButtonCell defaultTextColor]];
CGFloat fontSize = [NSFont systemFontSizeForControlSize:[self controlSize]];
NSFont* font = [NSFont controlContentFontOfSize:fontSize];
@@ -99,7 +103,7 @@
}
- (void)setTextColor:(NSColor*)color {
- textColor_.reset(color);
+ textColor_.reset([color retain]);
}
@end