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

Unified Diff: chrome/renderer/searchbox/searchbox_extension.cc

Issue 12319108: Prevent querying of restricted query values. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove query_state_ from SearchBox. Created 7 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
Index: chrome/renderer/searchbox/searchbox_extension.cc
diff --git a/chrome/renderer/searchbox/searchbox_extension.cc b/chrome/renderer/searchbox/searchbox_extension.cc
index cb745307fa252eaa6305c240237af0ab196bfa9b..50b24c70fb93665b777b87445b9e700209b37970 100644
--- a/chrome/renderer/searchbox/searchbox_extension.cc
+++ b/chrome/renderer/searchbox/searchbox_extension.cc
@@ -787,6 +787,9 @@ v8::Handle<v8::Value>
std::vector<InstantSuggestion> suggestions;
suggestions.push_back(InstantSuggestion(text, behavior, type));
SearchBox::Get(render_view)->SetSuggestions(suggestions);
+ // Clear the SearchBox's query text explicitly since this is a restricted
+ // value.
+ SearchBox::Get(render_view)->ClearQuery();
return v8::Undefined();
}
@@ -833,6 +836,9 @@ v8::Handle<v8::Value>
std::vector<InstantSuggestion> suggestions;
suggestions.push_back(InstantSuggestion(text, behavior, type));
SearchBox::Get(render_view)->SetSuggestions(suggestions);
+ // Clear the SearchBox's query text explicitly since this is a restricted
+ // value.
+ SearchBox::Get(render_view)->ClearQuery();
return v8::Undefined();
}

Powered by Google App Engine
This is Rietveld 408576698