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

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

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/extension_api/tts_engine_extension_api.cc
diff --git a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc
index e9951dfd4709a927daedf7195a02412a7d039748..eb952349886191d26134f15ae59d61c6207312f6 100644
--- a/chrome/browser/speech/extension_api/tts_engine_extension_api.cc
+++ b/chrome/browser/speech/extension_api/tts_engine_extension_api.cc
@@ -62,7 +62,12 @@ void WarnIfMissingPauseOrResumeListener(
} // namespace
-void GetExtensionVoices(Profile* profile, std::vector<VoiceData>* out_voices) {
+TtsExtensionEngine* TtsExtensionEngine::GetInstance() {
+ return Singleton<TtsExtensionEngine>::get();
+}
+
+void TtsExtensionEngine::GetVoices(Profile* profile,
+ std::vector<VoiceData>* out_voices) {
EventRouter* event_router = EventRouter::Get(profile);
DCHECK(event_router);
@@ -127,7 +132,8 @@ void GetExtensionVoices(Profile* profile, std::vector<VoiceData>* out_voices) {
}
}
-void ExtensionTtsEngineSpeak(Utterance* utterance, const VoiceData& voice) {
+void TtsExtensionEngine::Speak(Utterance* utterance,
+ const VoiceData& voice) {
// See if the engine supports the "end" event; if so, we can keep the
// utterance around and track it. If not, we're finished with this
// utterance now.
@@ -171,7 +177,7 @@ void ExtensionTtsEngineSpeak(Utterance* utterance, const VoiceData& voice) {
->DispatchEventToExtension(utterance->extension_id(), event.Pass());
}
-void ExtensionTtsEngineStop(Utterance* utterance) {
+void TtsExtensionEngine::Stop(Utterance* utterance) {
scoped_ptr<base::ListValue> args(new base::ListValue());
scoped_ptr<extensions::Event> event(new extensions::Event(
tts_engine_events::kOnStop, args.Pass()));
@@ -180,7 +186,7 @@ void ExtensionTtsEngineStop(Utterance* utterance) {
->DispatchEventToExtension(utterance->extension_id(), event.Pass());
}
-void ExtensionTtsEnginePause(Utterance* utterance) {
+void TtsExtensionEngine::Pause(Utterance* utterance) {
scoped_ptr<base::ListValue> args(new base::ListValue());
scoped_ptr<extensions::Event> event(new extensions::Event(
tts_engine_events::kOnPause, args.Pass()));
@@ -192,7 +198,7 @@ void ExtensionTtsEnginePause(Utterance* utterance) {
WarnIfMissingPauseOrResumeListener(profile, event_router, id);
}
-void ExtensionTtsEngineResume(Utterance* utterance) {
+void TtsExtensionEngine::Resume(Utterance* utterance) {
scoped_ptr<base::ListValue> args(new base::ListValue());
scoped_ptr<extensions::Event> event(new extensions::Event(
tts_engine_events::kOnResume, args.Pass()));
« no previous file with comments | « chrome/browser/speech/extension_api/tts_engine_extension_api.h ('k') | chrome/browser/speech/tts_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698