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" |
11 #include "chrome/browser/extensions/extension_event_router.h" | 11 #include "chrome/browser/extensions/extension_event_router.h" |
12 #include "chrome/browser/extensions/extension_service.h" | 12 #include "chrome/browser/extensions/extension_service.h" |
13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
14 #include "chrome/browser/speech/extension_api/tts_extension_api_constants.h" | 14 #include "chrome/browser/speech/extension_api/tts_extension_api_constants.h" |
15 #include "chrome/browser/speech/extension_api/tts_extension_api_controller.h" | 15 #include "chrome/browser/speech/extension_api/tts_extension_api_controller.h" |
16 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
17 | 17 |
| 18 using extensions::Extension; |
| 19 |
18 namespace constants = tts_extension_api_constants; | 20 namespace constants = tts_extension_api_constants; |
19 | 21 |
20 namespace events { | 22 namespace events { |
21 const char kOnSpeak[] = "ttsEngine.onSpeak"; | 23 const char kOnSpeak[] = "ttsEngine.onSpeak"; |
22 const char kOnStop[] = "ttsEngine.onStop"; | 24 const char kOnStop[] = "ttsEngine.onStop"; |
23 }; // namespace events | 25 }; // namespace events |
24 | 26 |
25 void GetExtensionVoices(Profile* profile, ListValue* result_voices) { | 27 void GetExtensionVoices(Profile* profile, ListValue* result_voices) { |
26 ExtensionService* service = profile->GetExtensionService(); | 28 ExtensionService* service = profile->GetExtensionService(); |
27 DCHECK(service); | 29 DCHECK(service); |
(...skipping 231 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
259 std::string error_message; | 261 std::string error_message; |
260 event->GetString(constants::kErrorMessageKey, &error_message); | 262 event->GetString(constants::kErrorMessageKey, &error_message); |
261 controller->OnTtsEvent( | 263 controller->OnTtsEvent( |
262 utterance_id, TTS_EVENT_ERROR, char_index, error_message); | 264 utterance_id, TTS_EVENT_ERROR, char_index, error_message); |
263 } else { | 265 } else { |
264 EXTENSION_FUNCTION_VALIDATE(false); | 266 EXTENSION_FUNCTION_VALIDATE(false); |
265 } | 267 } |
266 | 268 |
267 return true; | 269 return true; |
268 } | 270 } |
OLD | NEW |