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

@ -20,7 +20,6 @@
#include "base/strings/string_split.h"
#include "base/strings/stringprintf.h"
#include "chrome/renderer/printing/print_web_view_helper.h"
#include "chrome/renderer/tts_dispatcher.h"
#include "content/public/common/content_constants.h"
#include "content/public/common/content_switches.h"
#include "content/public/renderer/render_frame.h"
@ -51,6 +50,10 @@
#include "chrome/renderer/pepper/pepper_helper.h"
#endif // BUILDFLAG(ENABLE_PEPPER_FLASH)
#if BUILDFLAG(ENABLE_TTS)
#include "chrome/renderer/tts_dispatcher.h"
#endif // BUILDFLAG(ENABLE_TTS)
namespace atom {
namespace {
@ -204,7 +207,11 @@ void RendererClientBase::DidClearWindowObject(
std::unique_ptr<blink::WebSpeechSynthesizer>
RendererClientBase::OverrideSpeechSynthesizer(
blink::WebSpeechSynthesizerClient* client) {
#if BUILDFLAG(ENABLE_TTS)
return std::make_unique<TtsDispatcher>(client);
#else
return nullptr;
#endif
}
bool RendererClientBase::OverrideCreatePlugin(