refactor: move text-to-speech out of chromium_src (#15024)

* chore: add tts patch and buildflag, makes tts work again

* chore: add tts patch and buildflag, makes tts work again

* fix: make things compile

* build: add relevant tts files for linux

* fix: update patch and patch description, should now compile on mac

* build: move chrome specific sources under chromium_src:chrome target

* build: enable_extensions again

We are depending on them, check `//electron/chromium_src:chrome` target
for more info.

* fix: update tts.patch to receive notifications about browser context destruction

* fix: extend browser process from chrome layer

The global state g_browser_process is shared between //chrome
and //electron.

* spec: add basic speech synthesis test

* spec: skip speech tests on ci

* build: fix compilation on windows
This commit is contained in:
Heilig Benedek 2018-10-11 15:52:12 +02:00 committed by Charles Kerr
parent 5788600c46
commit 95696c9456
39 changed files with 625 additions and 3139 deletions

View file

@ -40,7 +40,6 @@
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "chrome/browser/printing/printing_message_filter.h"
#include "chrome/browser/speech/tts_message_filter.h"
#include "components/net_log/chrome_net_log.h"
#include "content/public/browser/browser_ppapi_host.h"
#include "content/public/browser/client_certificate_delegate.h"
@ -85,6 +84,10 @@
#include "atom/browser/fake_location_provider.h"
#endif // BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)
#if BUILDFLAG(ENABLE_TTS)
#include "chrome/browser/speech/tts_message_filter.h"
#endif // BUILDFLAG(ENABLE_TTS)
using content::BrowserThread;
namespace atom {
@ -207,7 +210,10 @@ void AtomBrowserClient::RenderProcessWillLaunch(
return;
host->AddFilter(new printing::PrintingMessageFilter(process_id));
host->AddFilter(new TtsMessageFilter(process_id, host->GetBrowserContext()));
#if BUILDFLAG(ENABLE_TTS)
host->AddFilter(new TtsMessageFilter(host->GetBrowserContext()));
#endif
ProcessPreferences prefs;
auto* web_preferences =