| Index: content/renderer/render_view_impl.cc
|
| diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc
|
| index 361940ed9257a00ccd7c6d498a7cb74738175deb..43f0c14c2c0665a8bfc664a58dee2f109dfa33a7 100644
|
| --- a/content/renderer/render_view_impl.cc
|
| +++ b/content/renderer/render_view_impl.cc
|
| @@ -2359,14 +2359,16 @@ void RenderViewImpl::OnFind(int request_id,
|
|
|
| WebRect selection_rect;
|
| bool result = false;
|
| + bool new_text_found;
|
|
|
| // 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, new_text_found);
|
|
|
| if (!result) {
|
| // don't leave text selected as you move to the next frame.
|
| @@ -2393,16 +2395,16 @@ void RenderViewImpl::OnFind(int request_id,
|
| // reported matches, but no frames after the focused_frame contain a
|
| // match for the search word(s).
|
| if (multi_frame && search_frame == focused_frame) {
|
| - result = search_frame->find(
|
| - request_id, search_text, options, true, // Force wrapping.
|
| - &selection_rect);
|
| + result = search_frame->find(request_id, search_text, options,
|
| + true, // Force wrapping.
|
| + &selection_rect, new_text_found);
|
| }
|
| }
|
|
|
| webview()->setFocusedFrame(search_frame);
|
| } while (!result && search_frame != focused_frame);
|
|
|
| - if (options.findNext && current_selection.isNull()) {
|
| + if (options.findNext && current_selection.isNull() && !new_text_found) {
|
| // Force the main_frame to report the actual count.
|
| main_frame->increaseMatchCount(0, request_id);
|
| } else {
|
|
|