| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/speech/extension_api/tts_engine_extension_api.h" | 5 #include "chrome/browser/speech/extension_api/tts_engine_extension_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 | 84 |
| 85 for (size_t i = 0; i < tts_voices->size(); ++i) { | 85 for (size_t i = 0; i < tts_voices->size(); ++i) { |
| 86 const extensions::TtsVoice& voice = tts_voices->at(i); | 86 const extensions::TtsVoice& voice = tts_voices->at(i); |
| 87 | 87 |
| 88 out_voices->push_back(VoiceData()); | 88 out_voices->push_back(VoiceData()); |
| 89 VoiceData& result_voice = out_voices->back(); | 89 VoiceData& result_voice = out_voices->back(); |
| 90 | 90 |
| 91 result_voice.native = false; | 91 result_voice.native = false; |
| 92 result_voice.name = voice.voice_name; | 92 result_voice.name = voice.voice_name; |
| 93 result_voice.lang = voice.lang; | 93 result_voice.lang = voice.lang; |
| 94 result_voice.remote = voice.remote; | |
| 95 result_voice.extension_id = extension->id(); | 94 result_voice.extension_id = extension->id(); |
| 96 if (voice.gender == constants::kGenderMale) | 95 if (voice.gender == constants::kGenderMale) |
| 97 result_voice.gender = TTS_GENDER_MALE; | 96 result_voice.gender = TTS_GENDER_MALE; |
| 98 else if (voice.gender == constants::kGenderFemale) | 97 else if (voice.gender == constants::kGenderFemale) |
| 99 result_voice.gender = TTS_GENDER_FEMALE; | 98 result_voice.gender = TTS_GENDER_FEMALE; |
| 100 else | 99 else |
| 101 result_voice.gender = TTS_GENDER_NONE; | 100 result_voice.gender = TTS_GENDER_NONE; |
| 102 | 101 |
| 103 for (std::set<std::string>::const_iterator iter = | 102 for (std::set<std::string>::const_iterator iter = |
| 104 voice.event_types.begin(); | 103 voice.event_types.begin(); |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 252 utterance_id, TTS_EVENT_PAUSE, char_index, std::string()); | 251 utterance_id, TTS_EVENT_PAUSE, char_index, std::string()); |
| 253 } else if (event_type == constants::kEventTypeResume) { | 252 } else if (event_type == constants::kEventTypeResume) { |
| 254 controller->OnTtsEvent( | 253 controller->OnTtsEvent( |
| 255 utterance_id, TTS_EVENT_RESUME, char_index, std::string()); | 254 utterance_id, TTS_EVENT_RESUME, char_index, std::string()); |
| 256 } else { | 255 } else { |
| 257 EXTENSION_FUNCTION_VALIDATE(false); | 256 EXTENSION_FUNCTION_VALIDATE(false); |
| 258 } | 257 } |
| 259 | 258 |
| 260 return true; | 259 return true; |
| 261 } | 260 } |
| OLD | NEW |