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

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

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_android.cc ('k') | chrome/browser/speech/tts_controller.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/tts_controller.h
diff --git a/chrome/browser/speech/tts_controller.h b/chrome/browser/speech/tts_controller.h
index 53ca53744a227a120c34eb35416c2b089c0fd2ca..b6b7372a645b9ca2d1c1bba57ba16da7cf383d39 100644
--- a/chrome/browser/speech/tts_controller.h
+++ b/chrome/browser/speech/tts_controller.h
@@ -80,6 +80,14 @@ class UtteranceEventDelegate {
const std::string& error_message) = 0;
};
+// Class that wants to be notified when the set of
+// voices has changed.
+class VoicesChangedDelegate {
+ public:
+ virtual ~VoicesChangedDelegate() {}
+ virtual void OnVoicesChanged() = 0;
+};
+
// One speech utterance.
class Utterance {
public:
@@ -263,6 +271,16 @@ class TtsController {
// finishes loading the built-in TTS component extension.
void RetrySpeakingQueuedUtterances();
+ // Called by the extension system or platform implementation when the
+ // list of voices may have changed and should be re-queried.
+ void VoicesChanged();
+
+ // Add a delegate that wants to be notified when the set of voices changes.
+ void AddVoicesChangedDelegate(VoicesChangedDelegate* delegate);
+
+ // Remove delegate that wants to be notified when the set of voices changes.
+ void RemoveVoicesChangedDelegate(VoicesChangedDelegate* delegate);
+
// For unit testing.
void SetPlatformImpl(TtsPlatformImpl* platform_impl);
int QueueSize();
@@ -302,6 +320,9 @@ class TtsController {
// A queue of utterances to speak after the current one finishes.
std::queue<Utterance*> utterance_queue_;
+ // A set of delegates that want to be notified when the voices change.
+ std::set<VoicesChangedDelegate*> voices_changed_delegates_;
+
// A pointer to the platform implementation of text-to-speech, for
// dependency injection.
TtsPlatformImpl* platform_impl_;
« no previous file with comments | « chrome/browser/speech/tts_android.cc ('k') | chrome/browser/speech/tts_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698