| 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_api_controller.h" | 5 #include "chrome/browser/extensions/extension_tts_api_controller.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/float_util.h" | 10 #include "base/float_util.h" |
| 11 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
| 12 #include "base/values.h" | 12 #include "base/values.h" |
| 13 #include "chrome/browser/extensions/extension_event_router.h" | 13 #include "chrome/browser/extensions/extension_event_router.h" |
| 14 #include "chrome/browser/extensions/extension_tts_api.h" | 14 #include "chrome/browser/extensions/extension_tts_api.h" |
| 15 #include "chrome/browser/extensions/extension_tts_api_constants.h" | 15 #include "chrome/browser/extensions/extension_tts_api_constants.h" |
| 16 #include "chrome/browser/extensions/extension_tts_api_platform.h" | 16 #include "chrome/browser/extensions/extension_tts_api_platform.h" |
| 17 #include "chrome/browser/extensions/extension_tts_engine_api.h" | 17 #include "chrome/browser/extensions/extension_tts_engine_api.h" |
| 18 #include "chrome/browser/profiles/profile.h" | 18 #include "chrome/browser/profiles/profile.h" |
| 19 #include "chrome/common/extensions/extension.h" | 19 #include "chrome/common/extensions/extension.h" |
| 20 | 20 |
| 21 namespace constants = extension_tts_api_constants; | 21 namespace constants = extension_tts_api_constants; |
| 22 | 22 |
| 23 namespace events { | 23 namespace events { |
| 24 const char kOnEvent[] = "experimental.ttsEngine.onEvent"; | 24 const char kOnEvent[] = "tts.onEvent"; |
| 25 }; // namespace events | 25 }; // namespace events |
| 26 | 26 |
| 27 std::string TtsEventTypeToString(TtsEventType event_type) { | 27 std::string TtsEventTypeToString(TtsEventType event_type) { |
| 28 switch (event_type) { | 28 switch (event_type) { |
| 29 case TTS_EVENT_START: | 29 case TTS_EVENT_START: |
| 30 return constants::kEventTypeStart; | 30 return constants::kEventTypeStart; |
| 31 case TTS_EVENT_END: | 31 case TTS_EVENT_END: |
| 32 return constants::kEventTypeEnd; | 32 return constants::kEventTypeEnd; |
| 33 case TTS_EVENT_WORD: | 33 case TTS_EVENT_WORD: |
| 34 return constants::kEventTypeWord; | 34 return constants::kEventTypeWord; |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 307 | 307 |
| 308 int ExtensionTtsController::QueueSize() { | 308 int ExtensionTtsController::QueueSize() { |
| 309 return static_cast<int>(utterance_queue_.size()); | 309 return static_cast<int>(utterance_queue_.size()); |
| 310 } | 310 } |
| 311 | 311 |
| 312 ExtensionTtsPlatformImpl* ExtensionTtsController::GetPlatformImpl() { | 312 ExtensionTtsPlatformImpl* ExtensionTtsController::GetPlatformImpl() { |
| 313 if (!platform_impl_) | 313 if (!platform_impl_) |
| 314 platform_impl_ = ExtensionTtsPlatformImpl::GetInstance(); | 314 platform_impl_ = ExtensionTtsPlatformImpl::GetInstance(); |
| 315 return platform_impl_; | 315 return platform_impl_; |
| 316 } | 316 } |
| OLD | NEW |