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

Unified Diff: content/renderer/render_frame_impl.cc

Issue 1605863002: Restart search in page when new text is found. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added default value for local var Created 4 years, 10 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 | third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/renderer/render_frame_impl.cc
diff --git a/content/renderer/render_frame_impl.cc b/content/renderer/render_frame_impl.cc
index 07b329340f02fd2eabd01141c038060d0f14b9a9..b3f440cdc51c7f7785144996e99dcfc91a73049d 100644
--- a/content/renderer/render_frame_impl.cc
+++ b/content/renderer/render_frame_impl.cc
@@ -5059,14 +5059,16 @@ void RenderFrameImpl::OnFind(int request_id,
WebRect selection_rect;
bool result = false;
+ bool active_now = false;
// If something is selected when we start searching it means we cannot just
// increment the current match ordinal; we need to re-generate it.
WebRange current_selection = focused_frame->selectionRange();
do {
- result = search_frame->find(request_id, search_text, options,
- wrap_within_frame, &selection_rect);
+ result =
+ search_frame->find(request_id, search_text, options, wrap_within_frame,
+ &selection_rect, &active_now);
if (!result) {
// Don't leave text selected as you move to the next frame.
@@ -5095,14 +5097,14 @@ void RenderFrameImpl::OnFind(int request_id,
if (multi_frame && search_frame == focused_frame) {
result = search_frame->find(request_id, search_text, options,
true, // Force wrapping.
- &selection_rect);
+ &selection_rect, &active_now);
}
}
render_view_->webview()->setFocusedFrame(search_frame);
} while (!result && search_frame != focused_frame);
- if (options.findNext && current_selection.isNull()) {
+ if (options.findNext && current_selection.isNull() && active_now) {
// Force the main_frame to report the actual count.
main_frame->increaseMatchCount(0, request_id);
} else {
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/markers/DocumentMarkerController.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698