| Index: chrome/browser/speech/tts_chromeos.cc
|
| diff --git a/chrome/browser/speech/tts_chromeos.cc b/chrome/browser/speech/tts_chromeos.cc
|
| index e42cb0c546b4642050ddd73fc9df48d3ef7dd4fd..162ae08739cca17fc88d6bc793a93f56183711cc 100644
|
| --- a/chrome/browser/speech/tts_chromeos.cc
|
| +++ b/chrome/browser/speech/tts_chromeos.cc
|
| @@ -2,8 +2,13 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/speech/tts_extension_loader_chromeos.h"
|
| +#include "chrome/browser/extensions/component_loader.h"
|
| +#include "chrome/browser/extensions/extension_service.h"
|
| +#include "chrome/browser/profiles/profile.h"
|
| +#include "chrome/browser/speech/tts_engine_extension_observer.h"
|
| #include "chrome/browser/speech/tts_platform.h"
|
| +#include "chrome/common/extensions/extension_constants.h"
|
| +#include "extensions/browser/extension_system.h"
|
|
|
| // Chrome OS doesn't have native TTS, instead it includes a built-in
|
| // component extension that provides speech synthesis. This class includes
|
| @@ -18,7 +23,19 @@ class TtsPlatformImplChromeOs
|
| }
|
|
|
| virtual bool LoadBuiltInTtsExtension(Profile* profile) OVERRIDE {
|
| - return TtsExtensionLoaderChromeOs::GetInstance(profile)->LoadTtsExtension();
|
| + // Check to see if the engine was previously loaded.
|
| + if (TtsEngineExtensionObserver::GetInstance(profile)->SawExtensionLoad(
|
| + extension_misc::kSpeechSynthesisExtensionId, true)) {
|
| + return false;
|
| + }
|
| +
|
| + // Load the component extension into this profile.
|
| + ExtensionService* extension_service =
|
| + extensions::ExtensionSystem::Get(profile)->extension_service();
|
| + DCHECK(extension_service);
|
| + extension_service->component_loader()
|
| + ->AddChromeOsSpeechSynthesisExtension();
|
| + return true;
|
| }
|
|
|
| virtual bool Speak(
|
|
|