OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "ui/app_list/views/speech_view.h" | 5 #include "ui/app_list/views/speech_view.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "grit/ui_resources.h" | 8 #include "grit/ui_resources.h" |
9 #include "grit/ui_strings.h" | 9 #include "grit/ui_strings.h" |
10 #include "ui/app_list/app_list_model.h" | 10 #include "ui/app_list/app_list_model.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 | 202 |
203 void SpeechView::OnSpeechResult(const base::string16& result, | 203 void SpeechView::OnSpeechResult(const base::string16& result, |
204 bool is_final) { | 204 bool is_final) { |
205 speech_result_->SetText(result); | 205 speech_result_->SetText(result); |
206 speech_result_->SetEnabledColor(kResultTextColor); | 206 speech_result_->SetEnabledColor(kResultTextColor); |
207 } | 207 } |
208 | 208 |
209 void SpeechView::OnSpeechRecognitionStateChanged( | 209 void SpeechView::OnSpeechRecognitionStateChanged( |
210 SpeechRecognitionState new_state) { | 210 SpeechRecognitionState new_state) { |
211 int resource_id = IDR_APP_LIST_SPEECH_MIC_OFF; | 211 int resource_id = IDR_APP_LIST_SPEECH_MIC_OFF; |
212 if (new_state == SPEECH_RECOGNITION_ON) | 212 if (new_state == SPEECH_RECOGNITION_RECOGNIZING) |
213 resource_id = IDR_APP_LIST_SPEECH_MIC_ON; | 213 resource_id = IDR_APP_LIST_SPEECH_MIC_ON; |
214 else if (new_state == SPEECH_RECOGNITION_IN_SPEECH) | 214 else if (new_state == SPEECH_RECOGNITION_IN_SPEECH) |
215 resource_id = IDR_APP_LIST_SPEECH_MIC_RECORDING; | 215 resource_id = IDR_APP_LIST_SPEECH_MIC_RECORDING; |
216 | 216 |
217 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); | 217 ui::ResourceBundle& bundle = ui::ResourceBundle::GetSharedInstance(); |
218 mic_button_->SetImage(views::Button::STATE_NORMAL, bundle.GetImageSkiaNamed( | 218 mic_button_->SetImage(views::Button::STATE_NORMAL, bundle.GetImageSkiaNamed( |
219 resource_id)); | 219 resource_id)); |
220 } | 220 } |
221 | 221 |
222 } // namespace app_list | 222 } // namespace app_list |
OLD | NEW |