Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3048)

Unified Diff: chrome/browser/views/toolbar_view.cc

Issue 119025: Add ability to theme our buttons.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 11 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/views/toolbar_view.cc
===================================================================
--- chrome/browser/views/toolbar_view.cc (revision 17327)
+++ chrome/browser/views/toolbar_view.cc (working copy)
@@ -238,38 +238,52 @@
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,
@@ -282,6 +296,8 @@
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));
@@ -292,6 +308,8 @@
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() {

Powered by Google App Engine
This is Rietveld 408576698