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

Unified Diff: content/browser/find_request_manager.cc

Issue 2790213002: Fix find-in-page "1 of 0" bug. (Closed)
Patch Set: Created 3 years, 9 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/find_request_manager.cc
diff --git a/content/browser/find_request_manager.cc b/content/browser/find_request_manager.cc
index 1936a5e381eed8f0faae7c97f31c94d1a31b2bb6..64e129726a3f76d371691e11537f00b3d975b40b 100644
--- a/content/browser/find_request_manager.cc
+++ b/content/browser/find_request_manager.cc
@@ -160,9 +160,13 @@ void FindRequestManager::OnFindReply(RenderFrameHost* rfh,
number_of_matches_ += matches_delta;
matches_per_frame_it->second = number_of_matches;
+ // All matches may have been removed since the last find reply.
+ if (rfh == active_frame_ && !number_of_matches)
+ relative_active_match_ordinal_ = 0;
+
// The active match ordinal may need updating since the number of matches
// before the active match may have changed.
- if (rfh != active_frame_)
+ if (rfh != active_frame_ || !number_of_matches)
UpdateActiveMatchOrdinal();
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698