Index: chrome/browser/ui/views/find_bar_view.cc |
=================================================================== |
--- chrome/browser/ui/views/find_bar_view.cc (revision 104959) |
+++ chrome/browser/ui/views/find_bar_view.cc (working copy) |
@@ -89,7 +89,6 @@ |
match_count_text_ = new views::Label(); |
match_count_text_->SetFont(rb.GetFont(ResourceBundle::BaseFont)); |
- match_count_text_->SetColor(kTextColorMatchCount); |
match_count_text_->SetHorizontalAlignment(views::Label::ALIGN_CENTER); |
AddChildView(match_count_text_); |
@@ -183,22 +182,20 @@ |
find_text_->SelectAll(); |
} |
- if (!find_text.empty() && have_valid_range) { |
- match_count_text_->SetText( |
- l10n_util::GetStringFUTF16(IDS_FIND_IN_PAGE_COUNT, |
- base::IntToString16(result.active_match_ordinal()), |
- base::IntToString16(result.number_of_matches()))); |
- |
- UpdateMatchCountAppearance(result.number_of_matches() == 0 && |
- result.final_update()); |
- } else { |
+ if (find_text.empty() || !have_valid_range) { |
// If there was no text entered, we don't show anything in the result count |
// area. |
- match_count_text_->SetText(string16()); |
- |
- UpdateMatchCountAppearance(false); |
+ ClearMatchCount(); |
+ return; |
} |
+ match_count_text_->SetText(l10n_util::GetStringFUTF16(IDS_FIND_IN_PAGE_COUNT, |
+ base::IntToString16(result.active_match_ordinal()), |
+ base::IntToString16(result.number_of_matches()))); |
+ |
+ UpdateMatchCountAppearance(result.number_of_matches() == 0 && |
+ result.final_update()); |
+ |
// The match_count label may have increased/decreased in size so we need to |
// do a layout and repaint the dialog so that the find text field doesn't |
// partially overlap the match-count label when it increases on no matches. |
@@ -454,12 +451,14 @@ |
if (no_match) { |
match_count_text_->set_background( |
views::Background::CreateSolidBackground(kBackgroundColorNoMatch)); |
- match_count_text_->SetColor(kTextColorNoMatch); |
+ match_count_text_->SetEnabledColor(kTextColorNoMatch); |
} else { |
match_count_text_->set_background( |
views::Background::CreateSolidBackground(kBackgroundColorMatch)); |
- match_count_text_->SetColor(kTextColorMatchCount); |
+ match_count_text_->SetEnabledColor(kTextColorMatchCount); |
} |
+ match_count_text_->SetBackgroundColor( |
+ match_count_text_->background()->get_color()); |
} |
bool FindBarView::FocusForwarderView::OnMousePressed( |