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

Unified Diff: content/browser/find_request_manager.cc

Issue 2802283002: Fix find-in-page "1 of 0" bug. (Closed)
Patch Set: Created 3 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 | « 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 5c2eeb2df374da1d18e384648cea298a81708156..7713bc3a5b962de9f96ae5660c376943b08f7b76 100644
--- a/content/browser/find_request_manager.cc
+++ b/content/browser/find_request_manager.cc
@@ -158,9 +158,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