OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/speech/tts_platform.h" | 5 #include "chrome/browser/speech/tts_platform.h" |
6 | 6 |
7 // Chrome OS doesn't have native TTS, instead it includes a built-in | 7 // Chrome OS doesn't have native TTS, instead it includes a built-in |
8 // component extension that provides speech synthesis. This class includes | 8 // component extension that provides speech synthesis. This class includes |
9 // an implementation of LoadBuiltInTtsExtension and dummy implementations of | 9 // an implementation of LoadBuiltInTtsExtension and dummy implementations of |
10 // everything else. | 10 // everything else. |
11 | 11 |
12 class Profile; | |
13 | |
14 class TtsPlatformImplChromeOs : public TtsPlatformImpl { | 12 class TtsPlatformImplChromeOs : public TtsPlatformImpl { |
15 public: | 13 public: |
16 // TtsPlatformImpl overrides: | 14 // TtsPlatformImpl overrides: |
17 virtual bool PlatformImplAvailable() OVERRIDE { | 15 virtual bool PlatformImplAvailable() OVERRIDE { |
18 return false; | 16 return false; |
19 } | 17 } |
20 | 18 |
21 virtual bool LoadBuiltInTtsExtension(Profile* profile) OVERRIDE { | 19 virtual bool LoadBuiltInTtsExtension( |
| 20 content::BrowserContext* browser_context) OVERRIDE { |
22 TtsEngineDelegate* tts_engine_delegate = | 21 TtsEngineDelegate* tts_engine_delegate = |
23 TtsController::GetInstance()->GetTtsEngineDelegate(); | 22 TtsController::GetInstance()->GetTtsEngineDelegate(); |
24 if (tts_engine_delegate) | 23 if (tts_engine_delegate) |
25 return tts_engine_delegate->LoadBuiltInTtsExtension(profile); | 24 return tts_engine_delegate->LoadBuiltInTtsExtension(browser_context); |
26 return false; | 25 return false; |
27 } | 26 } |
28 | 27 |
29 virtual bool Speak( | 28 virtual bool Speak( |
30 int utterance_id, | 29 int utterance_id, |
31 const std::string& utterance, | 30 const std::string& utterance, |
32 const std::string& lang, | 31 const std::string& lang, |
33 const VoiceData& voice, | 32 const VoiceData& voice, |
34 const UtteranceContinuousParameters& params) OVERRIDE { | 33 const UtteranceContinuousParameters& params) OVERRIDE { |
35 return false; | 34 return false; |
(...skipping 29 matching lines...) Expand all Loading... |
65 // static | 64 // static |
66 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { | 65 TtsPlatformImpl* TtsPlatformImpl::GetInstance() { |
67 return TtsPlatformImplChromeOs::GetInstance(); | 66 return TtsPlatformImplChromeOs::GetInstance(); |
68 } | 67 } |
69 | 68 |
70 // static | 69 // static |
71 TtsPlatformImplChromeOs* | 70 TtsPlatformImplChromeOs* |
72 TtsPlatformImplChromeOs::GetInstance() { | 71 TtsPlatformImplChromeOs::GetInstance() { |
73 return Singleton<TtsPlatformImplChromeOs>::get(); | 72 return Singleton<TtsPlatformImplChromeOs>::get(); |
74 } | 73 } |
OLD | NEW |