diff options
author | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 02:31:02 +0000 |
---|---|---|
committer | glen@chromium.org <glen@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-06-04 02:31:02 +0000 |
commit | 6e853c3ad131fe6713ce8efbac2270fee26ab5b2 (patch) | |
tree | d0c9c8a5d1949cbdd108059add44b86b989514f4 /chrome/browser/views | |
parent | 26e99ffd2a4179aefe5dbf8cbd5da74c0bc7a76b (diff) | |
download | chromium_src-6e853c3ad131fe6713ce8efbac2270fee26ab5b2.zip chromium_src-6e853c3ad131fe6713ce8efbac2270fee26ab5b2.tar.gz chromium_src-6e853c3ad131fe6713ce8efbac2270fee26ab5b2.tar.bz2 |
Add ability to theme our buttons.
BUG=12762
TEST=Verify that buttons can be themed.
Review URL: http://codereview.chromium.org/119025
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17586 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/toolbar_view.cc | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index df6ecf4..fd29674 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -239,38 +239,52 @@ void BrowserToolbarView::CreateRightSideControls(Profile* profile) { void BrowserToolbarView::LoadLeftSideControlsImages() { ThemeProvider* tp = GetThemeProvider(); + SkColor color = tp->GetColor(BrowserThemeProvider::COLOR_BUTTON_BACKGROUND); + SkBitmap* background = tp->GetBitmapNamed(IDR_THEME_BUTTON_BACKGROUND); + back_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_BACK)); back_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_BACK_H)); back_->SetImage(views::CustomButton::BS_PUSHED, - tp->GetBitmapNamed(IDR_BACK_P)); + tp->GetBitmapNamed(IDR_BACK_P)); back_->SetImage(views::CustomButton::BS_DISABLED, - tp->GetBitmapNamed(IDR_BACK_D)); + tp->GetBitmapNamed(IDR_BACK_D)); + back_->SetBackground(color, background, + tp->GetBitmapNamed(IDR_BACK_MASK)); forward_->SetImage(views::CustomButton::BS_NORMAL, - tp->GetBitmapNamed(IDR_FORWARD)); + tp->GetBitmapNamed(IDR_FORWARD)); forward_->SetImage(views::CustomButton::BS_HOT, - tp->GetBitmapNamed(IDR_FORWARD_H)); + tp->GetBitmapNamed(IDR_FORWARD_H)); forward_->SetImage(views::CustomButton::BS_PUSHED, - tp->GetBitmapNamed(IDR_FORWARD_P)); + tp->GetBitmapNamed(IDR_FORWARD_P)); forward_->SetImage(views::CustomButton::BS_DISABLED, - tp->GetBitmapNamed(IDR_FORWARD_D)); + tp->GetBitmapNamed(IDR_FORWARD_D)); + forward_->SetBackground(color, background, + tp->GetBitmapNamed(IDR_FORWARD_MASK)); reload_->SetImage(views::CustomButton::BS_NORMAL, - tp->GetBitmapNamed(IDR_RELOAD)); + tp->GetBitmapNamed(IDR_RELOAD)); reload_->SetImage(views::CustomButton::BS_HOT, - tp->GetBitmapNamed(IDR_RELOAD_H)); + tp->GetBitmapNamed(IDR_RELOAD_H)); reload_->SetImage(views::CustomButton::BS_PUSHED, - tp->GetBitmapNamed(IDR_RELOAD_P)); + tp->GetBitmapNamed(IDR_RELOAD_P)); + reload_->SetBackground(color, background, + tp->GetBitmapNamed(IDR_BUTTON_MASK)); home_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_HOME)); home_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_HOME_H)); home_->SetImage(views::CustomButton::BS_PUSHED, - tp->GetBitmapNamed(IDR_HOME_P)); + tp->GetBitmapNamed(IDR_HOME_P)); + home_->SetBackground(color, background, + tp->GetBitmapNamed(IDR_BUTTON_MASK)); } void BrowserToolbarView::LoadCenterStackImages() { ThemeProvider* tp = GetThemeProvider(); + SkColor color = tp->GetColor(BrowserThemeProvider::COLOR_BUTTON_BACKGROUND); + SkBitmap* background = tp->GetBitmapNamed(IDR_THEME_BUTTON_BACKGROUND); + star_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_STAR)); star_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_STAR_H)); star_->SetImage(views::CustomButton::BS_PUSHED, @@ -283,6 +297,8 @@ void BrowserToolbarView::LoadCenterStackImages() { tp->GetBitmapNamed(IDR_STARRED_H)); star_->SetToggledImage(views::CustomButton::BS_PUSHED, tp->GetBitmapNamed(IDR_STARRED_P)); + star_->SetBackground(color, background, + tp->GetBitmapNamed(IDR_STAR_MASK)); go_->SetImage(views::CustomButton::BS_NORMAL, tp->GetBitmapNamed(IDR_GO)); go_->SetImage(views::CustomButton::BS_HOT, tp->GetBitmapNamed(IDR_GO_H)); @@ -293,6 +309,8 @@ void BrowserToolbarView::LoadCenterStackImages() { tp->GetBitmapNamed(IDR_STOP_H)); go_->SetToggledImage(views::CustomButton::BS_PUSHED, tp->GetBitmapNamed(IDR_STOP_P)); + go_->SetBackground(color, background, + tp->GetBitmapNamed(IDR_GO_MASK)); } void BrowserToolbarView::LoadRightSideControlsImages() { |