diff options
author | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 00:22:24 +0000 |
---|---|---|
committer | mirandac@chromium.org <mirandac@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-08-11 00:22:24 +0000 |
commit | f4d6173a1f95178f4671ba88459db196badfdfac (patch) | |
tree | f5cd0813d8fb7485331c5a8f02d22676f7c78366 /chrome/browser/views | |
parent | 6b635eb7d60e4865ff4785dbcf47ace0f39c1e95 (diff) | |
download | chromium_src-f4d6173a1f95178f4671ba88459db196badfdfac.zip chromium_src-f4d6173a1f95178f4671ba88459db196badfdfac.tar.gz chromium_src-f4d6173a1f95178f4671ba88459db196badfdfac.tar.bz2 |
Mask the close button on the download shelf so that it's visible even in dark themes.
BUG= http://crbug.com/18451
TEST= Install a dark theme, cause download shelf to appear, note that the close button is visible.
Review URL: http://codereview.chromium.org/164276
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@22980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views')
-rw-r--r-- | chrome/browser/views/download_shelf_view.cc | 18 | ||||
-rw-r--r-- | chrome/browser/views/download_shelf_view.h | 6 |
2 files changed, 23 insertions, 1 deletions
diff --git a/chrome/browser/views/download_shelf_view.cc b/chrome/browser/views/download_shelf_view.cc index 47f0a74..c708713 100644 --- a/chrome/browser/views/download_shelf_view.cc +++ b/chrome/browser/views/download_shelf_view.cc @@ -72,7 +72,8 @@ int CenterPosition(int size, int target_size) { } // namespace DownloadShelfView::DownloadShelfView(Browser* browser, BrowserView* parent) - : browser_(browser), parent_(parent) { + : browser_(browser), + parent_(parent) { parent->AddChildView(this); Init(); } @@ -99,6 +100,7 @@ void DownloadShelfView::Init() { rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); close_button_->SetImage(views::CustomButton::BS_PUSHED, rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); + UpdateButtonColors(); AddChildView(close_button_); new_item_animation_.reset(new SlideAnimation(this)); @@ -284,6 +286,20 @@ bool DownloadShelfView::CanFitFirstDownloadItem() { return item_size.width() < available_width; } +void DownloadShelfView::UpdateButtonColors() { + ResourceBundle& rb = ResourceBundle::GetSharedInstance(); + if (GetThemeProvider()) { + close_button_->SetBackground( + GetThemeProvider()->GetColor(BrowserThemeProvider::COLOR_TAB_TEXT), + rb.GetBitmapNamed(IDR_CLOSE_BAR), + rb.GetBitmapNamed(IDR_CLOSE_BAR_MASK)); + } +} + +void DownloadShelfView::ThemeChanged() { + UpdateButtonColors(); +} + void DownloadShelfView::LinkActivated(views::Link* source, int event_flags) { browser_->ShowDownloadsTab(); } diff --git a/chrome/browser/views/download_shelf_view.h b/chrome/browser/views/download_shelf_view.h index 3cf6cea..a35a6b73 100644 --- a/chrome/browser/views/download_shelf_view.h +++ b/chrome/browser/views/download_shelf_view.h @@ -81,6 +81,12 @@ class DownloadShelfView : public DownloadShelf, // Returns true if the shelf is wide enough to show the first download item. bool CanFitFirstDownloadItem(); + // Called on theme change. + void UpdateButtonColors(); + + // Overridden from views::View. + virtual void ThemeChanged(); + // The browser for this shelf. Browser* browser_; |