diff options
author | thestig <thestig@chromium.org> | 2015-11-12 15:01:33 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-11-12 23:02:29 +0000 |
commit | 6057a6b26a758d3542b9d74579e4e517b49244a9 (patch) | |
tree | 6faf05ec4b9cd9f7bf4526a9fffff3115bc53ebe /extensions/browser/guest_view | |
parent | 3e70670d660be0ff2a0973199882d8d2c32a2298 (diff) | |
download | chromium_src-6057a6b26a758d3542b9d74579e4e517b49244a9.zip chromium_src-6057a6b26a758d3542b9d74579e4e517b49244a9.tar.gz chromium_src-6057a6b26a758d3542b9d74579e4e517b49244a9.tar.bz2 |
Prevent guest views from issuing a search for empty text.
Do the same for Android webview.
Set up roadblocks along the way to prevent this from happening again.
BUG=535086
Review URL: https://codereview.chromium.org/1365563003
Cr-Commit-Position: refs/heads/master@{#359419}
Diffstat (limited to 'extensions/browser/guest_view')
-rw-r--r-- | extensions/browser/guest_view/web_view/web_view_find_helper.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/extensions/browser/guest_view/web_view/web_view_find_helper.cc b/extensions/browser/guest_view/web_view/web_view_find_helper.cc index d8e0b0b..ecc35b4 100644 --- a/extensions/browser/guest_view/web_view/web_view_find_helper.cc +++ b/extensions/browser/guest_view/web_view/web_view_find_helper.cc @@ -132,6 +132,13 @@ void WebViewFindHelper::Find( if (!full_options->findNext) current_find_session_ = insert_result.first->second; + // Handle the empty |search_text| case internally. + if (search_text.empty()) { + guest_web_contents->StopFinding(content::STOP_FIND_ACTION_CLEAR_SELECTION); + FindReply(current_find_request_id_, 0, gfx::Rect(), 0, true); + return; + } + guest_web_contents->Find(current_find_request_id_, search_text, *full_options); } |