Jeremy Apthorp 2019-01-09 16:44:44 -08:00
parent 2cbf3080d0
commit 3b88dd6ef7
4 changed files with 26 additions and 11 deletions

View file

@ -94,6 +94,7 @@
#endif // BUILDFLAG(OVERRIDE_LOCATION_PROVIDER) #endif // BUILDFLAG(OVERRIDE_LOCATION_PROVIDER)
#if BUILDFLAG(ENABLE_TTS) #if BUILDFLAG(ENABLE_TTS)
#include "chrome/browser/speech/tts_controller_delegate_impl.h"
#include "chrome/browser/speech/tts_message_filter.h" #include "chrome/browser/speech/tts_message_filter.h"
#endif // BUILDFLAG(ENABLE_TTS) #endif // BUILDFLAG(ENABLE_TTS)
@ -367,6 +368,14 @@ AtomBrowserClient::CreateSpeechRecognitionManagerDelegate() {
return new AtomSpeechRecognitionManagerDelegate; return new AtomSpeechRecognitionManagerDelegate;
} }
content::TtsControllerDelegate* AtomBrowserClient::GetTtsControllerDelegate() {
#if BUILDFLAG(ENABLE_TTS)
return TtsControllerDelegateImpl::GetInstance();
#else
return nullptr;
#endif
}
void AtomBrowserClient::OverrideWebkitPrefs(content::RenderViewHost* host, void AtomBrowserClient::OverrideWebkitPrefs(content::RenderViewHost* host,
content::WebPreferences* prefs) { content::WebPreferences* prefs) {
prefs->javascript_enabled = true; prefs->javascript_enabled = true;

View file

@ -74,6 +74,7 @@ class AtomBrowserClient : public content::ContentBrowserClient,
service_manager::mojom::ServiceRequest* service_request) override; service_manager::mojom::ServiceRequest* service_request) override;
content::SpeechRecognitionManagerDelegate* content::SpeechRecognitionManagerDelegate*
CreateSpeechRecognitionManagerDelegate() override; CreateSpeechRecognitionManagerDelegate() override;
content::TtsControllerDelegate* GetTtsControllerDelegate() override;
void OverrideWebkitPrefs(content::RenderViewHost* render_view_host, void OverrideWebkitPrefs(content::RenderViewHost* render_view_host,
content::WebPreferences* prefs) override; content::WebPreferences* prefs) override;
SiteInstanceForNavigationType ShouldOverrideSiteInstanceForNavigation( SiteInstanceForNavigationType ShouldOverrideSiteInstanceForNavigation(

View file

@ -112,18 +112,15 @@ static_library("chrome") {
if (enable_tts) { if (enable_tts) {
sources += [ sources += [
"//chrome/browser/speech/tts_controller.h", "//chrome/browser/speech/tts_controller_delegate_impl.cc",
"//chrome/browser/speech/tts_controller_impl.cc", "//chrome/browser/speech/tts_controller_delegate_impl.h",
"//chrome/browser/speech/tts_controller_impl.h",
"//chrome/browser/speech/tts_mac.mm", "//chrome/browser/speech/tts_mac.mm",
"//chrome/browser/speech/tts_message_filter.cc", "//chrome/browser/speech/tts_message_filter.cc",
"//chrome/browser/speech/tts_message_filter.h", "//chrome/browser/speech/tts_message_filter.h",
"//chrome/browser/speech/tts_platform.cc",
"//chrome/browser/speech/tts_platform.h ", "//chrome/browser/speech/tts_platform.h ",
"//chrome/browser/speech/tts_platform_impl.cc",
"//chrome/browser/speech/tts_platform_impl.h",
"//chrome/browser/speech/tts_win.cc", "//chrome/browser/speech/tts_win.cc",
"//chrome/common/tts_messages.h",
"//chrome/common/tts_utterance_request.cc",
"//chrome/common/tts_utterance_request.h",
"//chrome/renderer/tts_dispatcher.cc", "//chrome/renderer/tts_dispatcher.cc",
"//chrome/renderer/tts_dispatcher.h", "//chrome/renderer/tts_dispatcher.h",
] ]

View file

@ -132,10 +132,18 @@ index 7ff9a9219beffc015ae8a96303595ee529715819..d2394892c2a0d2b4f88407cd412af143
+ browser_context_shutdown_notifier_.reset(); + browser_context_shutdown_notifier_.reset();
} }
diff --git a/chrome/browser/speech/tts_message_filter.h b/chrome/browser/speech/tts_message_filter.h diff --git a/chrome/browser/speech/tts_message_filter.h b/chrome/browser/speech/tts_message_filter.h
index 2fbbc4b4f2a79eac6b686894f2b6463abe404e50..c4712cebfba0efeb62a9061a997055c94ae41e3e 100644 index 2fbbc4b4f2a79eac6b686894f2b6463abe404e50..e02c1af7e002a70df5fa925ba758c7c2379ffac5 100644
--- a/chrome/browser/speech/tts_message_filter.h --- a/chrome/browser/speech/tts_message_filter.h
+++ b/chrome/browser/speech/tts_message_filter.h +++ b/chrome/browser/speech/tts_message_filter.h
@@ -21,7 +21,6 @@ class BrowserContext; @@ -8,6 +8,7 @@
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "base/synchronization/lock.h"
+#include "components/keyed_service/core/keyed_service_shutdown_notifier.h"
#include "content/public/browser/browser_message_filter.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_observer.h"
@@ -21,7 +22,6 @@ class BrowserContext;
struct TtsUtteranceRequest; struct TtsUtteranceRequest;
class TtsMessageFilter : public content::BrowserMessageFilter, class TtsMessageFilter : public content::BrowserMessageFilter,
@ -143,7 +151,7 @@ index 2fbbc4b4f2a79eac6b686894f2b6463abe404e50..c4712cebfba0efeb62a9061a997055c9
public content::UtteranceEventDelegate, public content::UtteranceEventDelegate,
public content::VoicesChangedDelegate { public content::VoicesChangedDelegate {
public: public:
@@ -63,15 +62,13 @@ class TtsMessageFilter : public content::BrowserMessageFilter, @@ -63,15 +63,13 @@ class TtsMessageFilter : public content::BrowserMessageFilter,
// about to be deleted. // about to be deleted.
bool Valid(); bool Valid();