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/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 TtsController::GetInstance()->Pause(); | 295 TtsController::GetInstance()->Pause(); |
296 return true; | 296 return true; |
297 } | 297 } |
298 | 298 |
299 bool TtsResumeFunction::RunSync() { | 299 bool TtsResumeFunction::RunSync() { |
300 TtsController::GetInstance()->Resume(); | 300 TtsController::GetInstance()->Resume(); |
301 return true; | 301 return true; |
302 } | 302 } |
303 | 303 |
304 bool TtsIsSpeakingFunction::RunSync() { | 304 bool TtsIsSpeakingFunction::RunSync() { |
305 SetResult(base::Value::CreateBooleanValue( | 305 SetResult( |
306 TtsController::GetInstance()->IsSpeaking())); | 306 new base::FundamentalValue(TtsController::GetInstance()->IsSpeaking())); |
307 return true; | 307 return true; |
308 } | 308 } |
309 | 309 |
310 bool TtsGetVoicesFunction::RunSync() { | 310 bool TtsGetVoicesFunction::RunSync() { |
311 std::vector<VoiceData> voices; | 311 std::vector<VoiceData> voices; |
312 TtsController::GetInstance()->GetVoices(GetProfile(), &voices); | 312 TtsController::GetInstance()->GetVoices(GetProfile(), &voices); |
313 | 313 |
314 scoped_ptr<base::ListValue> result_voices(new base::ListValue()); | 314 scoped_ptr<base::ListValue> result_voices(new base::ListValue()); |
315 for (size_t i = 0; i < voices.size(); ++i) { | 315 for (size_t i = 0; i < voices.size(); ++i) { |
316 const VoiceData& voice = voices[i]; | 316 const VoiceData& voice = voices[i]; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
360 } | 360 } |
361 | 361 |
362 static base::LazyInstance<BrowserContextKeyedAPIFactory<TtsAPI> > g_factory = | 362 static base::LazyInstance<BrowserContextKeyedAPIFactory<TtsAPI> > g_factory = |
363 LAZY_INSTANCE_INITIALIZER; | 363 LAZY_INSTANCE_INITIALIZER; |
364 | 364 |
365 BrowserContextKeyedAPIFactory<TtsAPI>* TtsAPI::GetFactoryInstance() { | 365 BrowserContextKeyedAPIFactory<TtsAPI>* TtsAPI::GetFactoryInstance() { |
366 return g_factory.Pointer(); | 366 return g_factory.Pointer(); |
367 } | 367 } |
368 | 368 |
369 } // namespace extensions | 369 } // namespace extensions |
OLD | NEW |