Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(405)

Unified Diff: chrome/browser/extensions/extension_tts_api_linux.cc

Issue 3640001: Refactored TTS extension code so that the platform-specific TTS... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/extensions/extension_tts_api_linux.cc
===================================================================
--- chrome/browser/extensions/extension_tts_api_linux.cc (revision 0)
+++ chrome/browser/extensions/extension_tts_api_linux.cc (revision 0)
@@ -0,0 +1,58 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/browser/extensions/extension_tts_api.h"
+
+#include "base/singleton.h"
+#include "chrome/browser/chromeos/cros/cros_library.h"
+#include "chrome/browser/chromeos/cros/speech_synthesis_library.h"
+
+namespace util = extension_tts_api_util;
+
+namespace {
+const char kNotSupportedError[] =
+ "Native speech synthesis not supported on this platform.";
+};
+
+class ExtensionTtsPlatformImplLinux : public ExtensionTtsPlatformImpl {
+ public:
+ virtual bool Speak(
+ const std::string& utterance,
+ const std::string& language,
+ const std::string& gender,
+ double rate,
+ double pitch,
+ double volume) {
+ error_ = kNotSupportedError;
+ return false;
+ }
+
+ virtual bool StopSpeaking() {
+ error_ = kNotSupportedError;
+ return false;
+ }
+
+ virtual bool IsSpeaking() {
+ error_ = kNotSupportedError;
+ return false;
+ }
+
+ // Get the single instance of this class.
+ static ExtensionTtsPlatformImplLinux* GetInstance() {
+ return ExtensionTtsPlatformImplLinux::GetInstance();
+ }
+
+ private:
+ ExtensionTtsPlatformImplLinux() {}
+ virtual ~ExtensionTtsPlatformImplLinux() {}
+
+ friend struct DefaultSingletonTraits<ExtensionTtsPlatformImplLinux>;
+
+ DISALLOW_COPY_AND_ASSIGN(ExtensionTtsPlatformImplLinux);
+};
+
+// static
+ExtensionTtsPlatformImpl* ExtensionTtsPlatformImpl::GetInstance() {
+ return ExtensionTtsPlatformImplLinux::GetInstance();
+}
Property changes on: chrome/browser/extensions/extension_tts_api_linux.cc
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome/browser/extensions/extension_tts_api_gtk.cc ('k') | chrome/browser/extensions/extension_tts_api_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698