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

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

Issue 2409643002: [Extensions] Convert some ChromeSyncExtensionFunctions (Closed)
Patch Set: Created 4 years, 2 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/extension_api/tts_extension_api.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/speech/extension_api/tts_extension_api.cc
diff --git a/chrome/browser/speech/extension_api/tts_extension_api.cc b/chrome/browser/speech/extension_api/tts_extension_api.cc
index 0bab877437d16a878da8519407a30708ac0a8612..c7d605d70e2350c4f09ce5c4bfbe53075c651d1b 100644
--- a/chrome/browser/speech/extension_api/tts_extension_api.cc
+++ b/chrome/browser/speech/extension_api/tts_extension_api.cc
@@ -295,30 +295,29 @@ bool TtsSpeakFunction::RunAsync() {
return true;
}
-bool TtsStopSpeakingFunction::RunSync() {
+ExtensionFunction::ResponseAction TtsStopSpeakingFunction::Run() {
TtsController::GetInstance()->Stop();
- return true;
+ return RespondNow(NoArguments());
}
-bool TtsPauseFunction::RunSync() {
+ExtensionFunction::ResponseAction TtsPauseFunction::Run() {
TtsController::GetInstance()->Pause();
- return true;
+ return RespondNow(NoArguments());
}
-bool TtsResumeFunction::RunSync() {
+ExtensionFunction::ResponseAction TtsResumeFunction::Run() {
TtsController::GetInstance()->Resume();
- return true;
+ return RespondNow(NoArguments());
}
-bool TtsIsSpeakingFunction::RunSync() {
- SetResult(base::MakeUnique<base::FundamentalValue>(
- TtsController::GetInstance()->IsSpeaking()));
- return true;
+ExtensionFunction::ResponseAction TtsIsSpeakingFunction::Run() {
+ return RespondNow(OneArgument(base::MakeUnique<base::FundamentalValue>(
+ TtsController::GetInstance()->IsSpeaking())));
}
-bool TtsGetVoicesFunction::RunSync() {
+ExtensionFunction::ResponseAction TtsGetVoicesFunction::Run() {
std::vector<VoiceData> voices;
- TtsController::GetInstance()->GetVoices(GetProfile(), &voices);
+ TtsController::GetInstance()->GetVoices(browser_context(), &voices);
std::unique_ptr<base::ListValue> result_voices(new base::ListValue());
for (size_t i = 0; i < voices.size(); ++i) {
@@ -347,8 +346,7 @@ bool TtsGetVoicesFunction::RunSync() {
result_voices->Append(std::move(result_voice));
}
- SetResult(std::move(result_voices));
- return true;
+ return RespondNow(OneArgument(std::move(result_voices)));
}
TtsAPI::TtsAPI(content::BrowserContext* context) {
« no previous file with comments | « chrome/browser/speech/extension_api/tts_extension_api.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698