Find-in-page should not ding while deleting characters.
BUG=18120
TEST=Open google.com, type Ctrl+F, type in garbage. Erase one letter at a time and there should be no beeping while you erase. Try it again, but this time use shift-delete to cut a few letters off the end. It should not ding. Now Copy the whole find string, press Esc, open Find again and on Paste it should not ding.
Review URL: http://codereview.chromium.org/338005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@30092 0039d316-1c4b-4281-b951-d872f2087c98
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 657bee4..38760534 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -1084,6 +1084,9 @@
find_text = *last_search_prepopulate_text_;
}
+ // Keep track of the previous search.
+ previous_find_text_ = find_text_;
+
// This is a FindNext operation if we are searching for the same text again,
// or if the passed in search text is empty (FindNext keyboard shortcut). The
// exception to this is if the Find was aborted (then we don't want FindNext
@@ -1117,6 +1120,7 @@
// by the user, but the UI has not been dismissed.
if (!clear_selection)
find_ui_active_ = false;
+ find_text_.clear();
find_op_aborted_ = true;
last_search_result_ = FindNotificationDetails();
render_view_host()->StopFinding(clear_selection);