| 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_extension_api.h" | 5 #include "chrome/browser/speech/extension_api/tts_extension_api.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 return true; | 180 return true; |
| 181 } | 181 } |
| 182 | 182 |
| 183 // static | 183 // static |
| 184 TtsAPI* TtsAPI::Get(Profile* profile) { | 184 TtsAPI* TtsAPI::Get(Profile* profile) { |
| 185 return ProfileKeyedAPIFactory<TtsAPI>::GetForProfile(profile); | 185 return ProfileKeyedAPIFactory<TtsAPI>::GetForProfile(profile); |
| 186 } | 186 } |
| 187 | 187 |
| 188 TtsAPI::TtsAPI(Profile* profile) { | 188 TtsAPI::TtsAPI(Profile* profile) { |
| 189 ManifestHandler::Register(extension_manifest_keys::kTtsEngine, | 189 ManifestHandler::Register(extension_manifest_keys::kTtsEngine, |
| 190 new TtsEngineManifestHandler); | 190 make_linked_ptr(new TtsEngineManifestHandler)); |
| 191 ExtensionFunctionRegistry* registry = | 191 ExtensionFunctionRegistry* registry = |
| 192 ExtensionFunctionRegistry::GetInstance(); | 192 ExtensionFunctionRegistry::GetInstance(); |
| 193 registry->RegisterFunction<ExtensionTtsEngineSendTtsEventFunction>(); | 193 registry->RegisterFunction<ExtensionTtsEngineSendTtsEventFunction>(); |
| 194 registry->RegisterFunction<TtsGetVoicesFunction>(); | 194 registry->RegisterFunction<TtsGetVoicesFunction>(); |
| 195 registry->RegisterFunction<TtsIsSpeakingFunction>(); | 195 registry->RegisterFunction<TtsIsSpeakingFunction>(); |
| 196 registry->RegisterFunction<TtsSpeakFunction>(); | 196 registry->RegisterFunction<TtsSpeakFunction>(); |
| 197 registry->RegisterFunction<TtsStopSpeakingFunction>(); | 197 registry->RegisterFunction<TtsStopSpeakingFunction>(); |
| 198 } | 198 } |
| 199 | 199 |
| 200 TtsAPI::~TtsAPI() { | 200 TtsAPI::~TtsAPI() { |
| 201 } | 201 } |
| 202 | 202 |
| 203 static base::LazyInstance<ProfileKeyedAPIFactory<TtsAPI> > | 203 static base::LazyInstance<ProfileKeyedAPIFactory<TtsAPI> > |
| 204 g_factory = LAZY_INSTANCE_INITIALIZER; | 204 g_factory = LAZY_INSTANCE_INITIALIZER; |
| 205 | 205 |
| 206 ProfileKeyedAPIFactory<TtsAPI>* TtsAPI::GetFactoryInstance() { | 206 ProfileKeyedAPIFactory<TtsAPI>* TtsAPI::GetFactoryInstance() { |
| 207 return &g_factory.Get(); | 207 return &g_factory.Get(); |
| 208 } | 208 } |
| 209 | 209 |
| 210 } // namespace extensions | 210 } // namespace extensions |
| OLD | NEW |