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

Unified Diff: chrome/browser/speech/extension_api/tts_engine_extension_api.h

Issue 188633003: Revert of Eliminate the dependence of tts extension API for tts_controller.cc (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 9 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 | « AUTHORS ('k') | chrome/browser/speech/extension_api/tts_engine_extension_api.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/extension_api/tts_engine_extension_api.h
diff --git a/chrome/browser/speech/extension_api/tts_engine_extension_api.h b/chrome/browser/speech/extension_api/tts_engine_extension_api.h
index fdee2b93aa6f82336dadcc98c54005024f6fa1d7..1a2c25b9b91efbaa008aa7e37a8453392f66df78 100644
--- a/chrome/browser/speech/extension_api/tts_engine_extension_api.h
+++ b/chrome/browser/speech/extension_api/tts_engine_extension_api.h
@@ -28,19 +28,32 @@
extern const char kOnResume[];
}
-// TtsEngineDelegate implementation used by TtsController.
-class TtsExtensionEngine : public TtsEngineDelegate {
- public:
- static TtsExtensionEngine* GetInstance();
+// Return a list of all available voices registered by extensions.
+void GetExtensionVoices(Profile* profile, std::vector<VoiceData>* out_voices);
- // Overridden from TtsEngineDelegate:
- virtual void GetVoices(Profile* profile,
- std::vector<VoiceData>* out_voices) OVERRIDE;
- virtual void Speak(Utterance* utterance, const VoiceData& voice) OVERRIDE;
- virtual void Stop(Utterance* utterance) OVERRIDE;
- virtual void Pause(Utterance* utterance) OVERRIDE;
- virtual void Resume(Utterance* utterance) OVERRIDE;
-};
+// Find the first extension with a tts_voices in its
+// manifest that matches the speech parameters of this utterance.
+// If found, store a pointer to the extension in |matching_extension| and
+// the index of the voice within the extension in |voice_index| and
+// return true.
+bool GetMatchingExtensionVoice(Utterance* utterance,
+ const extensions::Extension** matching_extension,
+ size_t* voice_index);
+
+// Speak the given utterance by sending an event to the given TTS engine
+// extension voice.
+void ExtensionTtsEngineSpeak(Utterance* utterance,
+ const VoiceData& voice);
+
+// Stop speaking the given utterance by sending an event to the extension
+// associated with this utterance.
+void ExtensionTtsEngineStop(Utterance* utterance);
+
+// Pause in the middle of speaking this utterance.
+void ExtensionTtsEnginePause(Utterance* utterance);
+
+// Resume speaking this utterance.
+void ExtensionTtsEngineResume(Utterance* utterance);
// Hidden/internal extension function used to allow TTS engine extensions
// to send events back to the client that's calling tts.speak().
« no previous file with comments | « AUTHORS ('k') | chrome/browser/speech/extension_api/tts_engine_extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698