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

Unified Diff: chrome/browser/chromeos/accessibility/accessibility_util.cc

Issue 10850018: Allow spoken feedback to be routed to TTS extensions, not just built-in TTS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 8 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/accessibility/accessibility_util.cc
===================================================================
--- chrome/browser/chromeos/accessibility/accessibility_util.cc (revision 148955)
+++ chrome/browser/chromeos/accessibility/accessibility_util.cc (working copy)
@@ -20,7 +20,7 @@
#include "chrome/browser/prefs/pref_service.h"
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/profiles/profile_manager.h"
-#include "chrome/browser/speech/extension_api/tts_extension_api_platform.h"
+#include "chrome/browser/speech/extension_api/tts_extension_api_controller.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_messages.h"
#include "chrome/common/extensions/extension_resource.h"
@@ -197,13 +197,19 @@
EnableSpokenFeedback(spoken_feedback_enabled, login_web_ui);
};
-void Speak(const std::string& utterance) {
+void Speak(const std::string& text) {
UtteranceContinuousParameters params;
- ExtensionTtsPlatformImpl::GetInstance()->Speak(
- -1, // No utterance ID because we don't need a callback when it finishes.
- utterance.c_str(),
- g_browser_process->GetApplicationLocale(),
- params);
+
+ Profile* profile = ProfileManager::GetDefaultProfile();
+ Utterance* utterance = new Utterance(profile);
+ utterance->set_text(text);
+ utterance->set_lang(g_browser_process->GetApplicationLocale());
+ utterance->set_continuous_parameters(params);
+ utterance->set_can_enqueue(false);
+ utterance->set_options(new DictionaryValue());
+
+ ExtensionTtsController* controller = ExtensionTtsController::GetInstance();
+ controller->SpeakOrEnqueue(utterance);
}
bool IsSpokenFeedbackEnabled() {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698