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

Unified Diff: chrome/browser/chromeos/cros/cros_library.cc

Issue 1775006: Adding speech synthesis library to access TTS feature in libcros. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 8 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/chromeos/cros/cros_library.cc
===================================================================
--- chrome/browser/chromeos/cros/cros_library.cc (revision 45736)
+++ chrome/browser/chromeos/cros/cros_library.cc (working copy)
@@ -11,6 +11,7 @@
#include "chrome/browser/chromeos/cros/mount_library.h"
#include "chrome/browser/chromeos/cros/network_library.h"
#include "chrome/browser/chromeos/cros/power_library.h"
+#include "chrome/browser/chromeos/cros/speech_synthesis_library.h"
#include "chrome/browser/chromeos/cros/synaptics_library.h"
namespace chromeos {
@@ -22,6 +23,7 @@
mount_lib_(NULL),
network_lib_(NULL),
power_lib_(NULL),
+ speech_synthesis_lib_(NULL),
synaptics_lib_(NULL),
own_library_loader_(true),
own_cryptohome_loader_(true),
@@ -30,6 +32,7 @@
own_mount_loader_(true),
own_network_loader_(true),
own_power_loader_(true),
+ own_speech_synthesis_library_(true),
own_synaptics_library_(true),
loaded_(false),
load_error_(false),
@@ -52,6 +55,8 @@
delete network_lib_;
if (own_power_loader_ && power_lib_)
delete power_lib_;
+ if (own_speech_synthesis_library_ && speech_synthesis_lib_)
+ delete speech_synthesis_lib_;
if (own_synaptics_library_ && synaptics_lib_)
delete synaptics_lib_;
if (test_api_)
@@ -99,6 +104,12 @@
return power_lib_;
}
+SpeechSynthesisLibrary* CrosLibrary::GetSpeechSynthesisLibrary() {
+ if (!speech_synthesis_lib_)
+ speech_synthesis_lib_ = new SpeechSynthesisLibraryImpl();
+ return speech_synthesis_lib_;
+}
+
SynapticsLibrary* CrosLibrary::GetSynapticsLibrary() {
if (!synaptics_lib_)
synaptics_lib_ = new SynapticsLibraryImpl();
@@ -179,6 +190,15 @@
library_->power_lib_ = library;
}
+void CrosLibrary::TestApi::SetSpeechSynthesisLibrary(
+ SpeechSynthesisLibrary* library, bool own) {
+ if (library_->own_speech_synthesis_library_ &&
+ library_->speech_synthesis_lib_)
+ delete library_->speech_synthesis_lib_;
+ library_->own_speech_synthesis_library_ = own;
+ library_->speech_synthesis_lib_ = library;
+}
+
void CrosLibrary::TestApi::SetSynapticsLibrary(SynapticsLibrary* library,
bool own) {
if (library_->own_synaptics_library_ && library_->synaptics_lib_)
@@ -188,4 +208,3 @@
}
} // end namespace.
-
« no previous file with comments | « chrome/browser/chromeos/cros/cros_library.h ('k') | chrome/browser/chromeos/cros/mock_speech_synthesis_library.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698