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

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

Issue 471853002: Use the new hotword extension in the launcher when it is enabled. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 6 years, 4 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 | « chrome/browser/search/hotword_service.cc ('k') | chrome/browser/ui/app_list/start_page_service.cc » ('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 4d55c940ec34c6517808d91bc32d6dab84578e7f..382de360605b707b7950c2ffcdd5f48f09e7a707 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc
@@ -483,6 +483,20 @@ void AppListViewDelegate::OnSpeechSoundLevelChanged(int16 level) {
void AppListViewDelegate::OnSpeechRecognitionStateChanged(
app_list::SpeechRecognitionState new_state) {
speech_ui_->SetSpeechRecognitionState(new_state);
+
+ app_list::StartPageService* service =
+ app_list::StartPageService::Get(profile_);
+ // With the new hotword extension, we need to re-request hotwording after
+ // speech recognition has stopped.
+ if (new_state == app_list::SPEECH_RECOGNITION_READY &&
+ HotwordService::IsExperimentalHotwordingEnabled() &&
+ service && service->HotwordEnabled()) {
+ HotwordService* hotword_service =
+ HotwordServiceFactory::GetForProfile(profile_);
+ if (hotword_service) {
+ hotword_service->RequestHotwordSession(this);
+ }
+ }
}
void AppListViewDelegate::OnProfileAdded(const base::FilePath& profile_path) {
« no previous file with comments | « chrome/browser/search/hotword_service.cc ('k') | chrome/browser/ui/app_list/start_page_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698