summaryrefslogtreecommitdiffstats
path: root/chrome/browser/tab_contents
diff options
context:
space:
mode:
authorfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-04 22:26:01 +0000
committerfinnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-06-04 22:26:01 +0000
commitd6e8d33d3cac179789c985c1c4f03c0885dd8bba (patch)
treead1db35e7a603e955f4e69367c0495414f16adae /chrome/browser/tab_contents
parente43cf994ac0b0840c6712346d8a8788c4a71574a (diff)
downloadchromium_src-d6e8d33d3cac179789c985c1c4f03c0885dd8bba.zip
chromium_src-d6e8d33d3cac179789c985c1c4f03c0885dd8bba.tar.gz
chromium_src-d6e8d33d3cac179789c985c1c4f03c0885dd8bba.tar.bz2
Fix: Clearing search 'foo', closing and reopening Find
should not prepopulate with 'foo'. We need to reset the remembered values when the user clears the search term from the Find box to prevent them from showing up on close+Reopen and on close+F3. Added test to cover these cases. This change also makes sure we don't clear the Find string when we don't need to, which was happening on close of the Find box and on new tab, causing the fix not to work. BUG=42639 TEST=Covered by new automated test. Review URL: http://codereview.chromium.org/2322006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48984 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r--chrome/browser/tab_contents/tab_contents.cc14
1 files changed, 9 insertions, 5 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc
index 8e2fff5..d3e993d 100644
--- a/chrome/browser/tab_contents/tab_contents.cc
+++ b/chrome/browser/tab_contents/tab_contents.cc
@@ -1245,12 +1245,16 @@ void TabContents::StartFinding(string16 search_string,
void TabContents::StopFinding(
FindBarController::SelectionAction selection_action) {
- // When the action is kClearAction, it means the find string has been cleared
- // by the user, but the UI has not been dismissed.
- if (selection_action != FindBarController::kClearSelection)
+ if (selection_action == FindBarController::kClearSelection) {
+ // kClearSelection means the find string has been cleared by the user, but
+ // the UI has not been dismissed. In that case we want to clear the
+ // previously remembered search (http://crbug.com/42639).
+ previous_find_text_ = string16();
+ } else {
find_ui_active_ = false;
- if (!find_text_.empty())
- previous_find_text_ = find_text_;
+ if (!find_text_.empty())
+ previous_find_text_ = find_text_;
+ }
find_text_.clear();
find_op_aborted_ = true;
last_search_result_ = FindNotificationDetails();