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

Unified Diff: ui/app_list/speech_ui_model.cc

Issue 149753002: Enables the 'hotword not listening' icon in the search box. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix breaks Created 6 years, 11 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 | « ui/app_list/speech_ui_model.h ('k') | ui/app_list/speech_ui_model_observer.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/speech_ui_model.cc
diff --git a/ui/app_list/speech_ui_model.cc b/ui/app_list/speech_ui_model.cc
index 3ec936b4a8182bcbd44ec7a673106d798e93ce36..4d0e4a6b883ee62efb0b2efb8fbd366469685c71 100644
--- a/ui/app_list/speech_ui_model.cc
+++ b/ui/app_list/speech_ui_model.cc
@@ -13,8 +13,9 @@ const int16 kDefaultSoundLevel = 200;
} // namespace
-SpeechUIModel::SpeechUIModel()
- : minimum_sound_level_(kDefaultSoundLevel),
+SpeechUIModel::SpeechUIModel(SpeechRecognitionState initial_state)
+ : state_(initial_state),
+ minimum_sound_level_(kDefaultSoundLevel),
maximum_sound_level_(kDefaultSoundLevel) {}
SpeechUIModel::~SpeechUIModel() {}
@@ -74,7 +75,8 @@ void SpeechUIModel::SetSpeechRecognitionState(
state_ = new_state;
// Revert the min/max sound level to the default.
- if (state_ == SPEECH_RECOGNITION_ON) {
+ if (state_ != SPEECH_RECOGNITION_RECOGNIZING &&
+ state_ != SPEECH_RECOGNITION_IN_SPEECH) {
minimum_sound_level_ = kDefaultSoundLevel;
maximum_sound_level_ = kDefaultSoundLevel;
}
« no previous file with comments | « ui/app_list/speech_ui_model.h ('k') | ui/app_list/speech_ui_model_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698