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

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

Issue 149233004: Revert "Automatically trigger installation of high-quality speech synthesis extension." (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkgr
Patch Set: Don't remove WillSpeakUtteranceWithVoice, it is dependent upon by a test now. Created 6 years, 10 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_extension_loader_chromeos.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 b966885cd30a62dbebc37e6093cb2d678698f1ed..503786d80983c239beac32e1c5ea299ce4caeb24 100644
--- a/chrome/browser/speech/tts_controller.cc
+++ b/chrome/browser/speech/tts_controller.cc
@@ -196,6 +196,14 @@ void TtsController::SpeakNow(Utterance* utterance) {
if (!success)
current_utterance_ = NULL;
+ // If the native voice wasn't able to process this speech, see if
+ // the browser has built-in TTS that isn't loaded yet.
+ if (!success &&
+ GetPlatformImpl()->LoadBuiltInTtsExtension(utterance->profile())) {
+ utterance_queue_.push(utterance);
+ return;
+ }
+
if (!success) {
utterance->OnTtsEvent(TTS_EVENT_ERROR, kInvalidCharIndex,
GetPlatformImpl()->error());
@@ -306,6 +314,11 @@ void TtsController::SpeakNextUtterance() {
}
}
+void TtsController::RetrySpeakingQueuedUtterances() {
+ if (current_utterance_ == NULL && !utterance_queue_.empty())
+ SpeakNextUtterance();
+}
+
void TtsController::ClearUtteranceQueue(bool send_events) {
while (!utterance_queue_.empty()) {
Utterance* utterance = utterance_queue_.front();
« no previous file with comments | « chrome/browser/speech/tts_controller.h ('k') | chrome/browser/speech/tts_extension_loader_chromeos.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698