Index: chrome/browser/views/tabs/tab_renderer.cc |
=================================================================== |
--- chrome/browser/views/tabs/tab_renderer.cc (revision 21189) |
+++ chrome/browser/views/tabs/tab_renderer.cc (working copy) |
@@ -54,6 +54,7 @@ |
static gfx::Font* title_font = NULL; |
static int title_font_height = 0; |
static SkBitmap* close_button_n = NULL; |
+static SkBitmap* close_button_m = NULL; |
static SkBitmap* close_button_h = NULL; |
static SkBitmap* close_button_p = NULL; |
static int close_button_height = 0; |
@@ -81,6 +82,7 @@ |
title_font_height = title_font->height(); |
close_button_n = rb.GetBitmapNamed(IDR_TAB_CLOSE); |
+ close_button_m = rb.GetBitmapNamed(IDR_TAB_CLOSE_MASK); |
close_button_h = rb.GetBitmapNamed(IDR_TAB_CLOSE_H); |
close_button_p = rb.GetBitmapNamed(IDR_TAB_CLOSE_P); |
close_button_width = close_button_n->width(); |
@@ -232,6 +234,7 @@ |
showing_icon_(false), |
showing_close_button_(false), |
fav_icon_hiding_offset_(0), |
+ close_button_color_(NULL), |
crash_animation_(NULL), |
should_display_crashed_favicon_(false), |
theme_provider_(NULL) { |
@@ -481,6 +484,18 @@ |
close_button_->SetBounds(lb.width() + kCloseButtonHorzFuzz, |
close_button_top, close_button_width, |
close_button_height); |
+ |
+ // If the close button color has changed, generate a new one. |
+ SkColor tab_text_color = |
+ GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT); |
+ if (!close_button_color_ || tab_text_color != close_button_color_) { |
+ close_button_color_ = tab_text_color; |
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
+ close_button_->SetBackground(close_button_color_, |
+ rb.GetBitmapNamed(IDR_TAB_CLOSE), |
+ rb.GetBitmapNamed(IDR_TAB_CLOSE_MASK)); |
+ } |
+ |
close_button_->SetVisible(true); |
} else { |
close_button_->SetBounds(0, 0, 0, 0); |