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