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