Index: chrome/browser/views/tabs/tab_strip.cc |
=================================================================== |
--- chrome/browser/views/tabs/tab_strip.cc (revision 19762) |
+++ chrome/browser/views/tabs/tab_strip.cc (working copy) |
@@ -16,7 +16,6 @@ |
#endif |
#include "base/gfx/size.h" |
#include "base/stl_util-inl.h" |
-#include "chrome/browser/browser_theme_provider.h" |
#include "chrome/browser/metrics/user_metrics.h" |
#include "chrome/browser/profile.h" |
#include "chrome/browser/tab_contents/tab_contents.h" |
@@ -596,13 +595,6 @@ |
GetTabAt(i)->SetBackgroundOffset(offset); |
} |
-void TabStrip::InitTabStripButtons() { |
- newtab_button_ = new NewTabButton(this); |
- LoadNewTabButtonImage(); |
- newtab_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_NEWTAB)); |
- AddChildView(newtab_button_); |
-} |
- |
/////////////////////////////////////////////////////////////////////////////// |
// TabStrip, views::View overrides: |
@@ -776,10 +768,6 @@ |
return this; |
} |
-void TabStrip::ThemeChanged() { |
- LoadNewTabButtonImage(); |
-} |
- |
/////////////////////////////////////////////////////////////////////////////// |
// TabStrip, TabStripModelObserver implementation: |
@@ -1087,7 +1075,23 @@ |
void TabStrip::Init() { |
model_->AddObserver(this); |
+ newtab_button_ = new NewTabButton(this); |
+ ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
+ SkBitmap* bitmap; |
+ bitmap = rb.GetBitmapNamed(IDR_NEWTAB_BUTTON); |
+ newtab_button_->SetImage(views::CustomButton::BS_NORMAL, bitmap); |
+ newtab_button_->SetImage(views::CustomButton::BS_PUSHED, |
+ rb.GetBitmapNamed(IDR_NEWTAB_BUTTON_P)); |
+ newtab_button_->SetImage(views::CustomButton::BS_HOT, |
+ rb.GetBitmapNamed(IDR_NEWTAB_BUTTON_H)); |
+ |
+ newtab_button_size_.SetSize(bitmap->width(), bitmap->height()); |
+ actual_newtab_button_size_ = newtab_button_size_; |
+ |
+ newtab_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_NEWTAB)); |
+ AddChildView(newtab_button_); |
+ |
if (drop_indicator_width == 0) { |
// Direction doesn't matter, both images are the same size. |
SkBitmap* drop_image = GetDropArrowImage(true); |
@@ -1096,24 +1100,6 @@ |
} |
} |
-void TabStrip::LoadNewTabButtonImage() { |
- ThemeProvider* tp = GetThemeProvider(); |
- |
- SkBitmap* bitmap = tp->GetBitmapNamed(IDR_NEWTAB_BUTTON); |
- SkColor color = tp->GetColor(BrowserThemeProvider::COLOR_BUTTON_BACKGROUND); |
- SkBitmap* background = tp->GetBitmapNamed( |
- IDR_THEME_WINDOW_CONTROL_BACKGROUND); |
- |
- newtab_button_->SetImage(views::CustomButton::BS_NORMAL, bitmap); |
- newtab_button_->SetImage(views::CustomButton::BS_PUSHED, |
- tp->GetBitmapNamed(IDR_NEWTAB_BUTTON_P)); |
- newtab_button_->SetImage(views::CustomButton::BS_HOT, |
- tp->GetBitmapNamed(IDR_NEWTAB_BUTTON_H)); |
- newtab_button_->SetBackground(color, background, |
- tp->GetBitmapNamed(IDR_NEWTAB_BUTTON_MASK)); |
- newtab_button_size_.SetSize(bitmap->width(), bitmap->height()); |
-} |
- |
Tab* TabStrip::GetTabAt(int index) const { |
DCHECK(index >= 0 && index < GetTabCount()); |
return tab_data_.at(index).tab; |