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

Unified Diff: chrome/browser/ui/search/instant_controller.cc

Issue 13963014: Local omnibox treats navsuggest suggestions as queries. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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/browser/ui/search/instant_controller.cc
diff --git a/chrome/browser/ui/search/instant_controller.cc b/chrome/browser/ui/search/instant_controller.cc
index f63aeab6c07470428821cdb5c2a6fbee6c264dc8..39eea50c41d8934accc09cd8fcd8fb80573735b2 100644
--- a/chrome/browser/ui/search/instant_controller.cc
+++ b/chrome/browser/ui/search/instant_controller.cc
@@ -617,8 +617,12 @@ void InstantController::HandleAutocompleteResults(
result.type = UTF8ToUTF16(AutocompleteMatch::TypeToString(match->type));
result.description = match->description;
result.destination_url = UTF8ToUTF16(match->destination_url.spec());
- if (from_search_provider)
+
+ // Setting the search_query field tells the Instant page to treat the
+ // suggestion as a query.
+ if (AutocompleteMatch::IsSearchType(match->type))
result.search_query = match->contents;
+
result.transition = match->transition;
result.relevance = match->relevance;
DVLOG(1) << " " << result.relevance << " " << result.type << " "
« no previous file with comments | « chrome/browser/ui/search/instant_controller.h ('k') | chrome/browser/ui/search/instant_extended_interactive_uitest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698