| 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 "chrome/browser/ui/webui/app_list/start_page_handler.h" | 5 #include "chrome/browser/ui/webui/app_list/start_page_handler.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 146 | 146 |
| 147 StartPageService* service = | 147 StartPageService* service = |
| 148 StartPageService::Get(Profile::FromWebUI(web_ui())); | 148 StartPageService::Get(Profile::FromWebUI(web_ui())); |
| 149 service->OnSpeechSoundLevelChanged(static_cast<int16>(level)); | 149 service->OnSpeechSoundLevelChanged(static_cast<int16>(level)); |
| 150 } | 150 } |
| 151 | 151 |
| 152 void StartPageHandler::HandleSpeechRecognition(const base::ListValue* args) { | 152 void StartPageHandler::HandleSpeechRecognition(const base::ListValue* args) { |
| 153 std::string state_string; | 153 std::string state_string; |
| 154 CHECK(args->GetString(0, &state_string)); | 154 CHECK(args->GetString(0, &state_string)); |
| 155 | 155 |
| 156 SpeechRecognitionState new_state = SPEECH_RECOGNITION_NOT_STARTED; | 156 SpeechRecognitionState new_state = SPEECH_RECOGNITION_OFF; |
| 157 if (state_string == "on") | 157 if (state_string == "READY") |
| 158 new_state = SPEECH_RECOGNITION_ON; | 158 new_state = SPEECH_RECOGNITION_READY; |
| 159 else if (state_string == "in-speech") | 159 else if (state_string == "HOTWORD_RECOGNIZING") |
| 160 new_state = SPEECH_RECOGNITION_HOTWORD_LISTENING; |
| 161 else if (state_string == "RECOGNIZING") |
| 162 new_state = SPEECH_RECOGNITION_RECOGNIZING; |
| 163 else if (state_string == "IN_SPEECH") |
| 160 new_state = SPEECH_RECOGNITION_IN_SPEECH; | 164 new_state = SPEECH_RECOGNITION_IN_SPEECH; |
| 165 else if (state_string == "STOPPING") |
| 166 new_state = SPEECH_RECOGNITION_STOPPING; |
| 161 | 167 |
| 162 StartPageService* service = | 168 StartPageService* service = |
| 163 StartPageService::Get(Profile::FromWebUI(web_ui())); | 169 StartPageService::Get(Profile::FromWebUI(web_ui())); |
| 164 service->OnSpeechRecognitionStateChanged(new_state); | 170 service->OnSpeechRecognitionStateChanged(new_state); |
| 165 } | 171 } |
| 166 | 172 |
| 167 } // namespace app_list | 173 } // namespace app_list |
| OLD | NEW |