• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.
4 
5 #include "chrome/browser/speech/tts_extension_loader_chromeos.h"
6 #include "chrome/browser/speech/tts_platform.h"
7 
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
11 // everything else.
12 class TtsPlatformImplChromeOs
13     : public TtsPlatformImpl {
14  public:
15   // TtsPlatformImpl overrides:
PlatformImplAvailable()16   virtual bool PlatformImplAvailable() OVERRIDE {
17     return false;
18   }
19 
LoadBuiltInTtsExtension(Profile * profile)20   virtual bool LoadBuiltInTtsExtension(Profile* profile) OVERRIDE {
21     return TtsExtensionLoaderChromeOs::GetInstance(profile)->LoadTtsExtension();
22   }
23 
Speak(int utterance_id,const std::string & utterance,const std::string & lang,const VoiceData & voice,const UtteranceContinuousParameters & params)24   virtual bool Speak(
25       int utterance_id,
26       const std::string& utterance,
27       const std::string& lang,
28       const VoiceData& voice,
29       const UtteranceContinuousParameters& params) OVERRIDE {
30     return false;
31   }
32 
StopSpeaking()33   virtual bool StopSpeaking() OVERRIDE {
34     return false;
35   }
36 
Pause()37   virtual void Pause() OVERRIDE {}
38 
Resume()39   virtual void Resume() OVERRIDE {}
40 
IsSpeaking()41   virtual bool IsSpeaking() OVERRIDE {
42     return false;
43   }
44 
GetVoices(std::vector<VoiceData> * out_voices)45   virtual void GetVoices(std::vector<VoiceData>* out_voices) OVERRIDE {
46   }
47 
48   // Get the single instance of this class.
49   static TtsPlatformImplChromeOs* GetInstance();
50 
51  private:
TtsPlatformImplChromeOs()52   TtsPlatformImplChromeOs() {}
~TtsPlatformImplChromeOs()53   virtual ~TtsPlatformImplChromeOs() {}
54 
55   friend struct DefaultSingletonTraits<TtsPlatformImplChromeOs>;
56 
57   DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplChromeOs);
58 };
59 
60 // static
GetInstance()61 TtsPlatformImpl* TtsPlatformImpl::GetInstance() {
62   return TtsPlatformImplChromeOs::GetInstance();
63 }
64 
65 // static
66 TtsPlatformImplChromeOs*
GetInstance()67 TtsPlatformImplChromeOs::GetInstance() {
68   return Singleton<TtsPlatformImplChromeOs>::get();
69 }
70