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

Unified Diff: chrome/browser/ui/app_list/search/omnibox_provider.cc

Issue 796293002: App list voice searches now prioritize exact-match web results. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit. Created 6 years 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 | « chrome/browser/ui/app_list/app_list_view_delegate.cc ('k') | ui/app_list/search/mixer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/search/omnibox_provider.cc
diff --git a/chrome/browser/ui/app_list/search/omnibox_provider.cc b/chrome/browser/ui/app_list/search/omnibox_provider.cc
index e32a7b932c76670b3ee167c3a0ac79c19527ecce..3c5eb9c3b2bb8ca513c7dd2c940b801f5949438c 100644
--- a/chrome/browser/ui/app_list/search/omnibox_provider.cc
+++ b/chrome/browser/ui/app_list/search/omnibox_provider.cc
@@ -15,6 +15,7 @@
#include "components/metrics/proto/omnibox_event.pb.h"
#include "components/omnibox/autocomplete_input.h"
#include "components/omnibox/autocomplete_match.h"
+#include "components/omnibox/autocomplete_match_type.h"
#include "grit/theme_resources.h"
#include "ui/app_list/search_result.h"
#include "ui/base/resource/resource_bundle.h"
@@ -90,6 +91,17 @@ class OmniboxResult : public SearchResult {
UpdateIcon();
UpdateTitleAndDetails();
+
+ // The raw "what you typed" search results should be promoted and
+ // automatically selected by voice queries. If a "history" result exactly
+ // matches what you typed, then the omnibox will not produce a "what you
+ // typed" result; therefore, we must also flag "history" results as voice
+ // results if they exactly match the query.
+ if (match_.type == AutocompleteMatchType::SEARCH_WHAT_YOU_TYPED ||
+ (match_.type == AutocompleteMatchType::SEARCH_HISTORY &&
+ match_.contents == match_.search_terms_args->original_query)) {
+ set_voice_result(true);
+ }
}
~OmniboxResult() override {}
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.cc ('k') | ui/app_list/search/mixer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698