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

Unified Diff: chrome/browser/speech/tts_controller.cc

Issue 15012027: Android implementation of text-to-speech code for Web Speech Synthesis API (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@tts_multivoice
Patch Set: Fix clang error Created 7 years, 7 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
« no previous file with comments | « chrome/browser/speech/tts_controller.h ('k') | chrome/browser/speech/tts_message_filter.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/tts_controller.cc
diff --git a/chrome/browser/speech/tts_controller.cc b/chrome/browser/speech/tts_controller.cc
index d7fb66e1e63bd4c78bd6ff20acc8081211aa6e57..73b094e64930de976b4e84f578efdb64a89f8094 100644
--- a/chrome/browser/speech/tts_controller.cc
+++ b/chrome/browser/speech/tts_controller.cc
@@ -156,6 +156,7 @@ void TtsController::SpeakNow(Utterance* utterance) {
voice.native = true;
if (!voice.native) {
+#if !defined(OS_ANDROID)
DCHECK(!voice.extension_id.empty());
current_utterance_ = utterance;
utterance->set_extension_id(voice.extension_id);
@@ -168,6 +169,7 @@ void TtsController::SpeakNow(Utterance* utterance) {
current_utterance_ = NULL;
SpeakNextUtterance();
}
+#endif
} else {
GetPlatformImpl()->clear_error();
bool success = GetPlatformImpl()->Speak(
@@ -197,7 +199,9 @@ void TtsController::SpeakNow(Utterance* utterance) {
void TtsController::Stop() {
if (current_utterance_ && !current_utterance_->extension_id().empty()) {
+#if !defined(OS_ANDROID)
ExtensionTtsEngineStop(current_utterance_);
+#endif
} else {
GetPlatformImpl()->clear_error();
GetPlatformImpl()->StopSpeaking();
@@ -230,8 +234,10 @@ void TtsController::OnTtsEvent(int utterance_id,
void TtsController::GetVoices(Profile* profile,
std::vector<VoiceData>* out_voices) {
+#if !defined(OS_ANDROID)
if (profile)
GetExtensionVoices(profile, out_voices);
+#endif
TtsPlatformImpl* platform_impl = GetPlatformImpl();
if (platform_impl && platform_impl->PlatformImplAvailable())
@@ -353,3 +359,20 @@ int TtsController::GetMatchingVoice(
return -1;
}
+void TtsController::VoicesChanged() {
+ for (std::set<VoicesChangedDelegate*>::iterator iter =
+ voices_changed_delegates_.begin();
+ iter != voices_changed_delegates_.end(); ++iter) {
+ (*iter)->OnVoicesChanged();
+ }
+}
+
+void TtsController::AddVoicesChangedDelegate(VoicesChangedDelegate* delegate) {
+ voices_changed_delegates_.insert(delegate);
+}
+
+void TtsController::RemoveVoicesChangedDelegate(
+ VoicesChangedDelegate* delegate) {
+ voices_changed_delegates_.erase(delegate);
+}
+
« no previous file with comments | « chrome/browser/speech/tts_controller.h ('k') | chrome/browser/speech/tts_message_filter.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698