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

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

Issue 374243004: Eliminate the dependence of tts extension API form tts_controller.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Skip the instantiation of TtsExtensionEngine for android. Created 6 years, 5 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/speech/tts_controller.h
diff --git a/chrome/browser/speech/tts_controller.h b/chrome/browser/speech/tts_controller.h
index c8d1c10a4cf456421169892bce4b179ce896a20a..0962f67dfe88d324fcead32b749ca5a97c3276db 100644
--- a/chrome/browser/speech/tts_controller.h
+++ b/chrome/browser/speech/tts_controller.h
@@ -77,6 +77,29 @@ struct VoiceData {
std::string native_voice_identifier;
};
+// Interface that delegates TTS requests to user-installed extensions.
+class TtsEngineDelegate {
+ public:
+ virtual ~TtsEngineDelegate() {}
+
+ // Return a list of all available voices registered.
+ virtual void GetVoices(Profile* profile,
+ std::vector<VoiceData>* out_voices) = 0;
+
+ // Speak the given utterance by sending an event to the given TTS engine.
+ virtual void Speak(Utterance* utterance, const VoiceData& voice) = 0;
+
+ // Stop speaking the given utterance by sending an event to the target
+ // associated with this utterance.
+ virtual void Stop(Utterance* utterance) = 0;
+
+ // Pause in the middle of speaking this utterance.
+ virtual void Pause(Utterance* utterance) = 0;
+
+ // Resume speaking this utterance.
+ virtual void Resume(Utterance* utterance) = 0;
+};
+
// Class that wants to receive events on utterances.
class UtteranceEventDelegate {
public:
@@ -297,6 +320,10 @@ class TtsController {
// Remove delegate that wants to be notified when the set of voices changes.
void RemoveVoicesChangedDelegate(VoicesChangedDelegate* delegate);
+ // Set the delegate that processes TTS requests with user-installed
+ // extensions.
+ void SetTtsEngineDelegate(TtsEngineDelegate* delegate);
+
// For unit testing.
void SetPlatformImpl(TtsPlatformImpl* platform_impl);
int QueueSize();
@@ -346,6 +373,9 @@ class TtsController {
// dependency injection.
TtsPlatformImpl* platform_impl_;
+ // The delegate that processes TTS requests with user-installed extensions.
+ TtsEngineDelegate* tts_engine_delegate_;
+
DISALLOW_COPY_AND_ASSIGN(TtsController);
};
« no previous file with comments | « chrome/browser/speech/extension_api/tts_engine_extension_api.cc ('k') | chrome/browser/speech/tts_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698