OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extensions/extension_tts_engine_api.h" | 5 #include "chrome/browser/extensions/extension_tts_engine_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/extensions/extension_tts_api_constants.h" | 13 #include "chrome/browser/extensions/extension_tts_api_constants.h" |
14 #include "chrome/browser/extensions/extension_tts_api_controller.h" | 14 #include "chrome/browser/extensions/extension_tts_api_controller.h" |
| 15 #include "chrome/browser/profiles/profile.h" |
15 #include "chrome/common/extensions/extension.h" | 16 #include "chrome/common/extensions/extension.h" |
16 | 17 |
17 namespace constants = extension_tts_api_constants; | 18 namespace constants = extension_tts_api_constants; |
18 | 19 |
19 namespace events { | 20 namespace events { |
20 const char kOnSpeak[] = "experimental.ttsEngine.onSpeak"; | 21 const char kOnSpeak[] = "experimental.ttsEngine.onSpeak"; |
21 const char kOnStop[] = "experimental.ttsEngine.onStop"; | 22 const char kOnStop[] = "experimental.ttsEngine.onStop"; |
22 }; // namespace events | 23 }; // namespace events |
23 | 24 |
24 void GetExtensionVoices(Profile* profile, ListValue* result_voices) { | 25 void GetExtensionVoices(Profile* profile, ListValue* result_voices) { |
(...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
251 std::string error_message; | 252 std::string error_message; |
252 event->GetString(constants::kErrorMessageKey, &error_message); | 253 event->GetString(constants::kErrorMessageKey, &error_message); |
253 controller->OnTtsEvent( | 254 controller->OnTtsEvent( |
254 utterance_id, TTS_EVENT_ERROR, char_index, error_message); | 255 utterance_id, TTS_EVENT_ERROR, char_index, error_message); |
255 } else { | 256 } else { |
256 EXTENSION_FUNCTION_VALIDATE(false); | 257 EXTENSION_FUNCTION_VALIDATE(false); |
257 } | 258 } |
258 | 259 |
259 return true; | 260 return true; |
260 } | 261 } |
OLD | NEW |