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

Unified Diff: chrome/browser/ui/app_list/app_list_view_delegate.cc

Issue 2846733004: Optimization: not sending answer server requests for voice queries. (Closed)
Patch Set: Created 3 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
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/search_answer_web_contents_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 00f6630b6ece027ea69f88effc28d00500e002fe..f4e864fee3699a01e15ede06455a8bc2d4a889e3 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc
@@ -281,7 +281,7 @@ void AppListViewDelegate::StartSearch() {
controller_->OnSearchStarted();
}
if (search_answer_delegate_)
- search_answer_delegate_->Update();
+ search_answer_delegate_->Update(is_voice_query_);
}
void AppListViewDelegate::StopSearch() {
@@ -297,6 +297,7 @@ void AppListViewDelegate::OpenSearchResult(
base::RecordAction(base::UserMetricsAction("AppList_AutoLaunched"));
search_controller_->OpenResult(result, event_flags);
is_voice_query_ = false;
+ model_->search_box()->SetText(base::string16());
xiyuan 2017/04/27 21:59:30 Is this necessary? This would trigger another Star
vadimt 2017/04/27 22:14:37 This is a fundamentally correct thing to do. We sh
xiyuan 2017/04/27 22:29:20 It will cause searches in other search providers.
vadimt 2017/04/29 00:48:28 Done. Moved is_voice_query_ from AppListViewDelega
}
void AppListViewDelegate::InvokeSearchResultAction(
@@ -315,6 +316,7 @@ void AppListViewDelegate::AutoLaunchCanceled() {
base::RecordAction(base::UserMetricsAction("AppList_AutoLaunchCanceled"));
// Cancelling the auto launch means we are no longer in a voice query.
is_voice_query_ = false;
+ model_->search_box()->SetText(base::string16());
}
auto_launch_timeout_ = base::TimeDelta();
}
@@ -531,7 +533,7 @@ void AppListViewDelegate::OnTemplateURLServiceChanged() {
SEARCH_ENGINE_GOOGLE;
model_->SetSearchEngineIsGoogle(is_google);
- search_answer_delegate_->Update();
+ search_answer_delegate_->Update(is_voice_query_);
app_list::StartPageService* start_page_service =
app_list::StartPageService::Get(profile_);
« no previous file with comments | « no previous file | chrome/browser/ui/app_list/search_answer_web_contents_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698