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

Unified Diff: chrome/browser/ui/find_bar/find_tab_helper.cc

Issue 1913543002: Fix for problem with activating find-in-page match via find tickbar. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 | « chrome/browser/ui/find_bar/find_tab_helper.h ('k') | content/browser/find_request_manager.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/find_bar/find_tab_helper.cc
diff --git a/chrome/browser/ui/find_bar/find_tab_helper.cc b/chrome/browser/ui/find_bar/find_tab_helper.cc
index c946502154cbb74152eb30ece61aab3bef1dcc26..1af22c38b900d40a61d0c4d2784dd186c64d0480 100644
--- a/chrome/browser/ui/find_bar/find_tab_helper.cc
+++ b/chrome/browser/ui/find_bar/find_tab_helper.cc
@@ -33,6 +33,7 @@ FindTabHelper::FindTabHelper(WebContents* web_contents)
find_ui_active_(false),
find_op_aborted_(false),
current_find_request_id_(find_request_id_counter_++),
+ current_find_session_id_(current_find_request_id_),
last_search_case_sensitive_(false),
last_search_result_() {
}
@@ -79,6 +80,8 @@ void FindTabHelper::StartFinding(base::string16 search_string,
!find_op_aborted_;
current_find_request_id_ = find_request_id_counter_++;
+ if (!find_next)
+ current_find_session_id_ = current_find_request_id_;
if (!search_string.empty())
find_text_ = search_string;
@@ -156,11 +159,10 @@ void FindTabHelper::HandleFindReply(int request_id,
const gfx::Rect& selection_rect,
int active_match_ordinal,
bool final_update) {
- // Ignore responses for requests that have been aborted.
- // 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.
- if (!find_op_aborted_ && request_id == current_find_request_id_) {
+ // Ignore responses for requests that have been aborted. Ignore responses for
+ // requests from previous sessiona. That way we won't act on stale results
ncarter (slow) 2016/04/25 18:02:38 "sessiona"
+ // when the user has already typed in another query.
+ if (!find_op_aborted_ && request_id >= current_find_session_id_) {
if (number_of_matches == -1)
number_of_matches = last_search_result_.number_of_matches();
if (active_match_ordinal == -1)
« no previous file with comments | « chrome/browser/ui/find_bar/find_tab_helper.h ('k') | content/browser/find_request_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698