summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
authortc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-24 18:52:42 +0000
committertc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-07-24 18:52:42 +0000
commit3ce7ced0978d5a9180cee7f237191c181c583f3d (patch)
tree1e1efe9d2f61405feb88157d51f387517a115365 /chrome
parentfba0771332e394b2bd10e472598c05b2b74ac3a1 (diff)
downloadchromium_src-3ce7ced0978d5a9180cee7f237191c181c583f3d.zip
chromium_src-3ce7ced0978d5a9180cee7f237191c181c583f3d.tar.gz
chromium_src-3ce7ced0978d5a9180cee7f237191c181c583f3d.tar.bz2
Fix a bug where an ongoing find operation would re-appear even
though we already changed the find text. On Linux, we would continue doing a find operation. On Windows, the find operation would stop, but the find box would not be cleared. TEST=Go to a long page (like the html 5 spec). Do a find for a very common string (e.g., any single letter). Press backspace to clear the find box while results are still populating. The find box should be cleared and the find stopped. Review URL: http://codereview.chromium.org/159321 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@21555 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/gtk/find_bar_gtk.cc2
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc4
2 files changed, 5 insertions, 1 deletions
diff --git a/chrome/browser/gtk/find_bar_gtk.cc b/chrome/browser/gtk/find_bar_gtk.cc
index c1d4fa0..d789943 100644
--- a/chrome/browser/gtk/find_bar_gtk.cc
+++ b/chrome/browser/gtk/find_bar_gtk.cc
@@ -306,7 +306,7 @@ void FindBarGtk::UpdateUIForFindResult(const FindNotificationDetails& result,
// repopulate the Find box with what was passed in.
std::string search_string(gtk_entry_get_text(GTK_ENTRY(text_entry_)));
if (search_string.empty() && !text_entry_utf8.empty()) {
- gtk_entry_set_text(GTK_ENTRY(text_entry_), text_entry_utf8.c_str());
+ SetFindText(find_text);
gtk_entry_select_region(GTK_ENTRY(text_entry_), 0, -1);
}
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index a5eefc5..9b5098f 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -1507,6 +1507,10 @@ void TabContents::OnFindReply(int request_id,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) {
+ // Ignore responses for requests that have been aborted.
+ if (find_op_aborted_)
+ return;
+
// Ignore responses for requests other than the one we have most recently
// issued. That way we won't act on stale results when the user has
// already typed in another query.