diff options
Diffstat (limited to 'chromium/content/browser/speech/tts_controller_impl.cc')
-rw-r--r-- | chromium/content/browser/speech/tts_controller_impl.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/chromium/content/browser/speech/tts_controller_impl.cc b/chromium/content/browser/speech/tts_controller_impl.cc index e34045ca4e1..2b7bd10feca 100644 --- a/chromium/content/browser/speech/tts_controller_impl.cc +++ b/chromium/content/browser/speech/tts_controller_impl.cc @@ -105,6 +105,10 @@ TtsControllerImpl* TtsControllerImpl::GetInstance() { return base::Singleton<TtsControllerImpl>::get(); } +void TtsControllerImpl::SetStopSpeakingWhenHidden(bool value) { + stop_speaking_when_hidden_ = value; +} + TtsControllerImpl::TtsControllerImpl() = default; TtsControllerImpl::~TtsControllerImpl() { @@ -166,7 +170,7 @@ bool TtsControllerImpl::StopCurrentUtteranceIfMatches(const GURL& source_url) { if (current_utterance_ && !current_utterance_->GetEngineId().empty()) { if (engine_delegate_) engine_delegate_->Stop(current_utterance_.get()); - } else { + } else if (GetTtsPlatform()->PlatformImplAvailable()) { GetTtsPlatform()->ClearError(); GetTtsPlatform()->StopSpeaking(); } @@ -531,10 +535,6 @@ void TtsControllerImpl::UpdateUtteranceDefaults(TtsUtterance* utterance) { utterance->SetContinuousParameters(rate, pitch, volume); } -void TtsControllerImpl::SetStopSpeakingWhenHidden(bool value) { - stop_speaking_when_hidden_ = value; -} - void TtsControllerImpl::StripSSML( const std::string& utterance, base::OnceCallback<void(const std::string&)> on_ssml_parsed) { |