Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / chrome / browser / speech / tts_chromeos.cc
blob4f35e9edc501c60118cdfa0934b06f49c8b41e11
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
10 // everything else.
12 class TtsPlatformImplChromeOs : public TtsPlatformImpl {
13 public:
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);
23 return false;
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 {
31 return false;
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();
47 private:
48 TtsPlatformImplChromeOs() {}
49 ~TtsPlatformImplChromeOs() override {}
51 friend struct DefaultSingletonTraits<TtsPlatformImplChromeOs>;
53 DISALLOW_COPY_AND_ASSIGN(TtsPlatformImplChromeOs);
56 // static
57 TtsPlatformImpl* TtsPlatformImpl::GetInstance() {
58 return TtsPlatformImplChromeOs::GetInstance();
61 // static
62 TtsPlatformImplChromeOs*
63 TtsPlatformImplChromeOs::GetInstance() {
64 return Singleton<TtsPlatformImplChromeOs>::get();