| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2011 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 "base/memory/singleton.h" | |
| 6 #include "chrome/browser/extensions/extension_tts_api_platform.h" | |
| 7 | |
| 8 namespace { | |
| 9 const char kNotSupportedError[] = | |
| 10 "Native speech synthesis not supported on this platform."; | |
| 11 }; | |
| 12 | |
| 13 class ExtensionTtsPlatformImplLinux : public ExtensionTtsPlatformImpl { | |
| 14 public: | |
| 15 virtual bool PlatformImplAvailable() { | |
| 16 return false; | |
| 17 } | |
| 18 | |
| 19 virtual bool Speak( | |
| 20 int utterance_id, | |
| 21 const std::string& utterance, | |
| 22 const std::string& lang, | |
| 23 const UtteranceContinuousParameters& params) { | |
| 24 error_ = kNotSupportedError; | |
| 25 return false; | |
| 26 } | |
| 27 | |
| 28 virtual bool StopSpeaking() { | |
| 29 error_ = kNotSupportedError; | |
| 30 return false; | |
| 31 } | |
| 32 | |
| 33 virtual bool IsSpeaking() { | |
| 34 error_ = kNotSupportedError; | |
| 35 return false; | |
| 36 } | |
| 37 | |
| 38 virtual bool SendsEvent(TtsEventType event_type) { | |
| 39 return false; | |
| 40 } | |
| 41 | |
| 42 // Get the single instance of this class. | |
| 43 static ExtensionTtsPlatformImplLinux* GetInstance() { | |
| 44 return Singleton<ExtensionTtsPlatformImplLinux>::get(); | |
| 45 } | |
| 46 | |
| 47 private: | |
| 48 ExtensionTtsPlatformImplLinux() {} | |
| 49 virtual ~ExtensionTtsPlatformImplLinux() {} | |
| 50 | |
| 51 friend struct DefaultSingletonTraits<ExtensionTtsPlatformImplLinux>; | |
| 52 | |
| 53 DISALLOW_COPY_AND_ASSIGN(ExtensionTtsPlatformImplLinux); | |
| 54 }; | |
| 55 | |
| 56 // static | |
| 57 ExtensionTtsPlatformImpl* ExtensionTtsPlatformImpl::GetInstance() { | |
| 58 return ExtensionTtsPlatformImplLinux::GetInstance(); | |
| 59 } | |
| OLD | NEW |