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_platform.h"
7 // Chrome OS doesn't have native TTS, instead it includes a built-in
8 // component extension that provides speech synthesis. This class includes
9 // an implementation of LoadBuiltInTtsExtension and dummy implementations of
12 class TtsPlatformImplChromeOs
: public TtsPlatformImpl
{
14 // TtsPlatformImpl overrides:
15 bool PlatformImplAvailable() override
{ return false; }
17 bool LoadBuiltInTtsExtension(
18 content::BrowserContext
* browser_context
) override
{
19 TtsEngineDelegate
* tts_engine_delegate
=
20 TtsController::GetInstance()->GetTtsEngineDelegate();
21 if (tts_engine_delegate
)
22 return tts_engine_delegate
->LoadBuiltInTtsExtension(browser_context
);
26 bool Speak(int utterance_id
,
27 const std::string
& utterance
,
28 const std::string
& lang
,
29 const VoiceData
& voice
,
30 const UtteranceContinuousParameters
& params
) override
{
34 bool StopSpeaking() override
{ return false; }
36 void Pause() override
{}
38 void Resume() override
{}
40 bool IsSpeaking() override
{ return false; }
42 void GetVoices(std::vector
<VoiceData
>* out_voices
) override
{}
44 // Get the single instance of this class.
45 static TtsPlatformImplChromeOs
* GetInstance();
48 TtsPlatformImplChromeOs() {}
49 ~TtsPlatformImplChromeOs() override
{}
51 friend struct base::DefaultSingletonTraits
<TtsPlatformImplChromeOs
>;
53 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplChromeOs
);
57 TtsPlatformImpl
* TtsPlatformImpl::GetInstance() {
58 return TtsPlatformImplChromeOs::GetInstance();
62 TtsPlatformImplChromeOs
*
63 TtsPlatformImplChromeOs::GetInstance() {
64 return base::Singleton
<TtsPlatformImplChromeOs
>::get();