diff options
author | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 23:13:21 +0000 |
---|---|---|
committer | finnur@chromium.org <finnur@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-11-20 23:13:21 +0000 |
commit | c1dc9f130ed8792c3e821f486d3c5e1ed4e567f3 (patch) | |
tree | 2b269b7c2ebe503d2e77b1361470ff750e592b91 /chrome/browser/tab_contents | |
parent | dec1c69abbba50d8d72ca5ddba7154953887c07b (diff) | |
download | chromium_src-c1dc9f130ed8792c3e821f486d3c5e1ed4e567f3.zip chromium_src-c1dc9f130ed8792c3e821f486d3c5e1ed4e567f3.tar.gz chromium_src-c1dc9f130ed8792c3e821f486d3c5e1ed4e567f3.tar.bz2 |
When you search for something, press F3, close the box and press F3 it would only open the Find box and not issue the search. This is because we set the prepopulate string to find_text and not find_text_ (the former is blank on F3). I have also changed the variable name to prevent this kind of confusion in the future.
BUG=28306
TEST=Automated test added.
Review URL: http://codereview.chromium.org/425003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32705 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/tab_contents')
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.cc | 17 | ||||
-rw-r--r-- | chrome/browser/tab_contents/tab_contents.h | 2 |
2 files changed, 9 insertions, 10 deletions
diff --git a/chrome/browser/tab_contents/tab_contents.cc b/chrome/browser/tab_contents/tab_contents.cc index 48b7cb6..4799e6e 100644 --- a/chrome/browser/tab_contents/tab_contents.cc +++ b/chrome/browser/tab_contents/tab_contents.cc @@ -1012,16 +1012,16 @@ void TabContents::DidMoveOrResize(ConstrainedWindow* window) { #endif } -void TabContents::StartFinding(string16 find_text, +void TabContents::StartFinding(string16 search_string, bool forward_direction, bool case_sensitive) { - // If find_text is empty, it means FindNext was pressed with a keyboard + // If search_string is empty, it means FindNext was pressed with a keyboard // shortcut so unless we have something to search for we return early. - if (find_text.empty() && find_text_.empty()) { + if (search_string.empty() && find_text_.empty()) { if (last_search_prepopulate_text_->empty()) return; // Try whatever we searched for last in any tab. - find_text = *last_search_prepopulate_text_; + search_string = *last_search_prepopulate_text_; } // Keep track of the previous search. @@ -1033,21 +1033,20 @@ void TabContents::StartFinding(string16 find_text, // because the highlighting has been cleared and we need it to reappear). We // therefore treat FindNext after an aborted Find operation as a full fledged // Find. - bool find_next = (find_text_ == find_text || find_text.empty()) && + bool find_next = (find_text_ == search_string || search_string.empty()) && (last_search_case_sensitive_ == case_sensitive) && !find_op_aborted_; if (!find_next) current_find_request_id_ = find_request_id_counter_++; - if (!find_text.empty()) - find_text_ = find_text; + if (!search_string.empty()) + find_text_ = search_string; last_search_case_sensitive_ = case_sensitive; find_op_aborted_ = false; // Keep track of what the last search was across the tabs. - *last_search_prepopulate_text_ = find_text; - + *last_search_prepopulate_text_ = find_text_; render_view_host()->StartFinding(current_find_request_id_, find_text_, forward_direction, diff --git a/chrome/browser/tab_contents/tab_contents.h b/chrome/browser/tab_contents/tab_contents.h index e440a53..33dae8a 100644 --- a/chrome/browser/tab_contents/tab_contents.h +++ b/chrome/browser/tab_contents/tab_contents.h @@ -488,7 +488,7 @@ class TabContents : public PageNavigator, // function does not block while a search is in progress. The controller will // receive the results through the notification mechanism. See Observe(...) // for details. - void StartFinding(string16 find_text, + void StartFinding(string16 search_string, bool forward_direction, bool case_sensitive); |