diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-04 22:33:59 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-12-04 22:33:59 +0000 |
commit | 91f3857074ba20f9ef7500f09b171797f6588660 (patch) | |
tree | 69a31f9616b3cff72fe9765060123507133b415d /chrome | |
parent | 7446beeb5002262d88844086f0926fc5c9784cfe (diff) | |
download | chromium_src-91f3857074ba20f9ef7500f09b171797f6588660.zip chromium_src-91f3857074ba20f9ef7500f09b171797f6588660.tar.gz chromium_src-91f3857074ba20f9ef7500f09b171797f6588660.tar.bz2 |
Windows: theme the close button for the find bar.
The blocked popup container isn't themed, but it will need similar treatment.
BUG=29101 (sort of)
TEST=use a dark theme, the close button should be visible on the findbar
Review URL: http://codereview.chromium.org/465049
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@33870 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/find_bar_view.cc | 20 | ||||
-rw-r--r-- | chrome/browser/views/find_bar_view.h | 3 |
2 files changed, 19 insertions, 4 deletions
diff --git a/chrome/browser/views/find_bar_view.cc b/chrome/browser/views/find_bar_view.cc index 31cab2a..2cb2de7 100644 --- a/chrome/browser/views/find_bar_view.cc +++ b/chrome/browser/views/find_bar_view.cc @@ -136,11 +136,11 @@ FindBarView::FindBarView(FindBarHost* host) close_button_->set_tag(CLOSE_TAG); close_button_->SetFocusable(true); close_button_->SetImage(views::CustomButton::BS_NORMAL, - rb.GetBitmapNamed(IDR_CLOSE_BAR)); + rb.GetBitmapNamed(IDR_CLOSE_BAR)); close_button_->SetImage(views::CustomButton::BS_HOT, - rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); + rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); close_button_->SetImage(views::CustomButton::BS_PUSHED, - rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); + rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); close_button_->SetTooltipText( l10n_util::GetString(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP)); AddChildView(close_button_); @@ -324,6 +324,8 @@ void FindBarView::Layout() { (height() - sz.height()) / 2, sz.width(), sz.height()); + // Set the color. + ThemeChanged(); // Next, the FindNext button to the left the close button. sz = find_next_button_->GetPreferredSize(); @@ -382,7 +384,7 @@ void FindBarView::Layout() { find_previous_button_->height()); } -void FindBarView::ViewHierarchyChanged(bool is_add, View *parent, View *child) { +void FindBarView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { if (is_add && child == this) { find_text_->SetHorizontalMargins(3, 3); // Left and Right margins. find_text_->RemoveBorder(); // We draw our own border (a background image). @@ -503,3 +505,13 @@ bool FindBarView::FocusForwarderView::OnMousePressed( FindBarHost* FindBarView::find_bar_host() const { return static_cast<FindBarHost*>(host()); } + +void FindBarView::ThemeChanged() { + 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)); + } +} diff --git a/chrome/browser/views/find_bar_view.h b/chrome/browser/views/find_bar_view.h index 8e74d5f..f3757f9 100644 --- a/chrome/browser/views/find_bar_view.h +++ b/chrome/browser/views/find_bar_view.h @@ -72,6 +72,9 @@ class FindBarView : public DropdownBarView, // Resets the background for the match count label. void ResetMatchCountBackground(); + // Overridden from views::View. + virtual void ThemeChanged(); + // We use a hidden view to grab mouse clicks and bring focus to the find // text box. This is because although the find text box may look like it // extends all the way to the find button, it only goes as far as to the |