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

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

Issue 39233: Fix bug 8369 and another regression (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/find_bar_view.cc
===================================================================
--- chrome/browser/views/find_bar_view.cc (revision 11005)
+++ chrome/browser/views/find_bar_view.cc (working copy)
@@ -214,9 +214,12 @@
match_count_text_->SetText(std::wstring());
}
- if (search_string.empty() || result.number_of_matches() > 0) {
+ if (search_string.empty() || result.number_of_matches() > 0 ||
+ !have_valid_range) {
// If there was no text entered or there were results, the match_count label
- // should have a normal background color.
+ // should have a normal background color. We also reset the background if
+ // we don't have_valid_range, so that the text field will not show red
+ // background when reopened after an unsuccessful find.
ResetMatchCountBackground();
} else if (result.final_update()) {
// Otherwise we show an error background behind the match_count label.
@@ -235,7 +238,12 @@
void FindBarView::SetFocusAndSelection() {
find_text_->RequestFocus();
- find_text_->SelectAll();
+ if (!find_text_->GetText().empty()) {
+ find_text_->SelectAll();
+
+ find_previous_button_->SetEnabled(true);
+ find_next_button_->SetEnabled(true);
+ }
}
///////////////////////////////////////////////////////////////////////////////
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698