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

Unified Diff: extensions/browser/guest_view/web_view/web_view_find_helper.cc

Issue 1365563003: Prevent guest views from issuing a search for empty text. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: parens Created 5 years, 1 month 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 | « content/renderer/render_view_impl.cc ('k') | extensions/test/data/web_view/apitest/main.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/browser/guest_view/web_view/web_view_find_helper.cc
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 d8e0b0bf6e0d0ddf40a8eac174e851f8dd40668b..ecc35b4d6742c7982c57b115c418411634a73017 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);
}
« no previous file with comments | « content/renderer/render_view_impl.cc ('k') | extensions/test/data/web_view/apitest/main.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698