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

Unified Diff: chrome/browser/ui/app_list/app_list_view_delegate.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
Index: chrome/browser/ui/app_list/app_list_view_delegate.cc
diff --git a/chrome/browser/ui/app_list/app_list_view_delegate.cc b/chrome/browser/ui/app_list/app_list_view_delegate.cc
index 11ac98d4f76283e4301e77985509764a79a6c786..40cda4528ff3298ffc541cc0aa42857fd4b6a7c1 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc
@@ -158,6 +158,7 @@ AppListViewDelegate::AppListViewDelegate(AppListControllerDelegate* controller)
: controller_(controller),
profile_(NULL),
model_(NULL),
+ is_voice_query_(false),
scoped_observer_(this) {
// TODO(vadimt): Remove ScopedTracker below once crbug.com/431326 is fixed.
tracked_objects::ScopedTracker tracking_profile(
@@ -465,7 +466,7 @@ void AppListViewDelegate::GetShortcutPathForApp(
void AppListViewDelegate::StartSearch() {
if (search_controller_) {
- search_controller_->Start();
+ search_controller_->Start(is_voice_query_);
controller_->OnSearchStarted();
}
}
@@ -498,6 +499,8 @@ base::TimeDelta AppListViewDelegate::GetAutoLaunchTimeout() {
void AppListViewDelegate::AutoLaunchCanceled() {
base::RecordAction(base::UserMetricsAction("AppList_AutoLaunchCanceled"));
auto_launch_timeout_ = base::TimeDelta();
+ // Cancelling the auto launch means we are no longer in a voice query.
+ is_voice_query_ = false;
}
void AppListViewDelegate::ViewInitialized() {
@@ -622,6 +625,7 @@ void AppListViewDelegate::OnSpeechResult(const base::string16& result,
if (is_final) {
auto_launch_timeout_ = base::TimeDelta::FromMilliseconds(
kAutoLaunchDefaultTimeoutMilliSec);
+ is_voice_query_ = true;
model_->search_box()->SetText(result);
}
}
« no previous file with comments | « chrome/browser/ui/app_list/app_list_view_delegate.h ('k') | chrome/browser/ui/app_list/search/omnibox_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698