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
3 // found in the LICENSE file.
5 #include "chrome/browser/speech/tts_extension_loader_chromeos.h"
6 #include "chrome/browser/speech/tts_platform.h"
8 // Chrome OS doesn't have native TTS, instead it includes a built-in
9 // component extension that provides speech synthesis. This class includes
10 // an implementation of LoadBuiltInTtsExtension and dummy implementations of
12 class TtsPlatformImplChromeOs
13 : public TtsPlatformImpl
{
15 // TtsPlatformImpl overrides:
16 virtual bool PlatformImplAvailable() OVERRIDE
{
20 virtual bool LoadBuiltInTtsExtension(Profile
* profile
) OVERRIDE
{
21 return TtsExtensionLoaderChromeOs::GetInstance(profile
)->LoadTtsExtension();
26 const std::string
& utterance
,
27 const std::string
& lang
,
28 const VoiceData
& voice
,
29 const UtteranceContinuousParameters
& params
) OVERRIDE
{
33 virtual bool StopSpeaking() OVERRIDE
{
37 virtual void Pause() OVERRIDE
{}
39 virtual void Resume() OVERRIDE
{}
41 virtual bool IsSpeaking() OVERRIDE
{
45 virtual void GetVoices(std::vector
<VoiceData
>* out_voices
) OVERRIDE
{
48 // Get the single instance of this class.
49 static TtsPlatformImplChromeOs
* GetInstance();
52 TtsPlatformImplChromeOs() {}
53 virtual ~TtsPlatformImplChromeOs() {}
55 friend struct DefaultSingletonTraits
<TtsPlatformImplChromeOs
>;
57 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplChromeOs
);
61 TtsPlatformImpl
* TtsPlatformImpl::GetInstance() {
62 return TtsPlatformImplChromeOs::GetInstance();
66 TtsPlatformImplChromeOs
*
67 TtsPlatformImplChromeOs::GetInstance() {
68 return Singleton
<TtsPlatformImplChromeOs
>::get();