mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
remove chromeos-only TtsControllerDelegate
Refs: https://chromium-review.googlesource.com/c/chromium/src/+/2255314
This commit is contained in:
@@ -153,13 +153,6 @@ static_library("chrome") {
|
||||
}
|
||||
}
|
||||
|
||||
if (enable_tts) {
|
||||
sources += [
|
||||
"//chrome/browser/speech/tts_controller_delegate_impl.cc",
|
||||
"//chrome/browser/speech/tts_controller_delegate_impl.h",
|
||||
]
|
||||
}
|
||||
|
||||
if (enable_widevine) {
|
||||
sources += [
|
||||
"//chrome/renderer/media/chrome_key_systems.cc",
|
||||
|
||||
@@ -44,7 +44,6 @@ notification_provenance.patch
|
||||
content_browser_main_loop.patch
|
||||
dump_syms.patch
|
||||
command-ismediakey.patch
|
||||
tts.patch
|
||||
printing.patch
|
||||
support_mixed_sandbox_with_zygote.patch
|
||||
fix_disable_usage_of_abort_report_np_in_mas_builds.patch
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
|
||||
From: Heilig Benedek <benecene@gmail.com>
|
||||
Date: Thu, 18 Oct 2018 17:08:03 -0700
|
||||
Subject: tts.patch
|
||||
|
||||
* Adds patch in //chrome/browser/speech/tts_controller_impl.cc
|
||||
to disable calls using chrome profile class.
|
||||
* Adds patch in //chrome/browser/speech/tts_message_filter.cc
|
||||
to remove reference to browser context when its signaled for
|
||||
destruction from content layer.
|
||||
|
||||
diff --git a/chrome/browser/speech/tts_controller_delegate_impl.cc b/chrome/browser/speech/tts_controller_delegate_impl.cc
|
||||
index a0503e80805d47167cbce9deb848cdf14024f17a..da970c937f75b2048b035d34d977fbe67a428a39 100644
|
||||
--- a/chrome/browser/speech/tts_controller_delegate_impl.cc
|
||||
+++ b/chrome/browser/speech/tts_controller_delegate_impl.cc
|
||||
@@ -103,6 +103,7 @@ void TtsControllerDelegateImpl::UpdateUtteranceDefaultsFromPrefs(
|
||||
|
||||
const PrefService* TtsControllerDelegateImpl::GetPrefService(
|
||||
content::TtsUtterance* utterance) {
|
||||
+#if 0
|
||||
// The utterance->GetBrowserContext() is null in tests.
|
||||
if (!utterance->GetBrowserContext())
|
||||
return nullptr;
|
||||
@@ -110,6 +111,8 @@ const PrefService* TtsControllerDelegateImpl::GetPrefService(
|
||||
const Profile* profile =
|
||||
Profile::FromBrowserContext(utterance->GetBrowserContext());
|
||||
return profile ? profile->GetPrefs() : nullptr;
|
||||
+#endif
|
||||
+ return nullptr;
|
||||
}
|
||||
|
||||
const base::DictionaryValue* TtsControllerDelegateImpl::GetLangToVoicePref(
|
||||
@@ -39,6 +39,8 @@
|
||||
#include "content/public/browser/render_process_host.h"
|
||||
#include "content/public/browser/render_view_host.h"
|
||||
#include "content/public/browser/site_instance.h"
|
||||
#include "content/public/browser/tts_controller.h"
|
||||
#include "content/public/browser/tts_platform.h"
|
||||
#include "content/public/common/content_descriptors.h"
|
||||
#include "content/public/common/content_paths.h"
|
||||
#include "content/public/common/content_switches.h"
|
||||
@@ -129,10 +131,6 @@
|
||||
#include "shell/browser/fake_location_provider.h"
|
||||
#endif // BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)
|
||||
|
||||
#if BUILDFLAG(ENABLE_TTS)
|
||||
#include "chrome/browser/speech/tts_controller_delegate_impl.h"
|
||||
#endif // BUILDFLAG(ENABLE_TTS)
|
||||
|
||||
#if BUILDFLAG(ENABLE_PRINTING)
|
||||
#include "chrome/browser/printing/printing_message_filter.h"
|
||||
#endif // BUILDFLAG(ENABLE_PRINTING)
|
||||
@@ -566,13 +564,8 @@ ElectronBrowserClient::CreateSpeechRecognitionManagerDelegate() {
|
||||
return new ElectronSpeechRecognitionManagerDelegate;
|
||||
}
|
||||
|
||||
content::TtsControllerDelegate*
|
||||
ElectronBrowserClient::GetTtsControllerDelegate() {
|
||||
#if BUILDFLAG(ENABLE_TTS)
|
||||
return TtsControllerDelegateImpl::GetInstance();
|
||||
#else
|
||||
content::TtsPlatform* ElectronBrowserClient::GetTtsPlatform() {
|
||||
return nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
void ElectronBrowserClient::OverrideWebkitPrefs(
|
||||
|
||||
@@ -87,7 +87,8 @@ class ElectronBrowserClient : public content::ContentBrowserClient,
|
||||
void RenderProcessWillLaunch(content::RenderProcessHost* host) override;
|
||||
content::SpeechRecognitionManagerDelegate*
|
||||
CreateSpeechRecognitionManagerDelegate() override;
|
||||
content::TtsControllerDelegate* GetTtsControllerDelegate() override;
|
||||
content::TtsPlatform* GetTtsPlatform() override;
|
||||
|
||||
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
|
||||
content::WebPreferences* prefs) override;
|
||||
SiteInstanceForNavigationType ShouldOverrideSiteInstanceForNavigation(
|
||||
|
||||
Reference in New Issue
Block a user