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

Unified Diff: chrome/browser/speech/tts_controller_impl.cc

Issue 647343004: Only send TTS VoicesChanged callbacks when TTS has been explicitly requested. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lkcr
Patch Set: Created 6 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 | « 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/speech/tts_controller_impl.cc
diff --git a/chrome/browser/speech/tts_controller_impl.cc b/chrome/browser/speech/tts_controller_impl.cc
index 2e8a83510347f3f27bf8ca1ed9646a794882a1c1..9cd26afe6e43ff3230f026948d90f5a573391c88 100644
--- a/chrome/browser/speech/tts_controller_impl.cc
+++ b/chrome/browser/speech/tts_controller_impl.cc
@@ -437,6 +437,11 @@ int TtsControllerImpl::GetMatchingVoice(
}
void TtsControllerImpl::VoicesChanged() {
+ // Existence of platform tts indicates explicit requests to tts. Since
+ // |VoicesChanged| can occur implicitly, only send if needed.
+ if (!platform_impl_)
+ return;
+
for (std::set<VoicesChangedDelegate*>::iterator iter =
voices_changed_delegates_.begin();
iter != voices_changed_delegates_.end(); ++iter) {
« 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