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

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: 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
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 7e7a94b65efe7c864bc1d6c9f2d30816f95e35f6..2cd340213030d1ef09ac5603edd4764c05285c53 100644
--- a/chrome/browser/ui/app_list/app_list_view_delegate.cc
+++ b/chrome/browser/ui/app_list/app_list_view_delegate.cc
@@ -456,6 +456,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) {

Powered by Google App Engine
This is Rietveld 408576698