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

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: Fixed MixerTest and add MixerTest.VoiceQuery. 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 d73fbcfc1b015d90c39136b0494c5d016469731e..fd90f670c16f877b81f5a0375d6c21a0f132b8f6 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(
@@ -429,7 +430,7 @@ void AppListViewDelegate::GetShortcutPathForApp(
void AppListViewDelegate::StartSearch() {
if (search_controller_) {
- search_controller_->Start();
+ search_controller_->Start(is_voice_query_);
controller_->OnSearchStarted();
}
}
@@ -462,6 +463,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() {
@@ -586,6 +589,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);
}
}

Powered by Google App Engine
This is Rietveld 408576698