OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SPEECH_MONITOR_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SPEECH_MONITOR_H_ |
6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SPEECH_MONITOR_H_ | 6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SPEECH_MONITOR_H_ |
7 | 7 |
8 #include <deque> | 8 #include <deque> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 public: | 21 public: |
22 SpeechMonitor(); | 22 SpeechMonitor(); |
23 ~SpeechMonitor() override; | 23 ~SpeechMonitor() override; |
24 | 24 |
25 // Blocks until the next utterance is spoken, and returns its text. | 25 // Blocks until the next utterance is spoken, and returns its text. |
26 std::string GetNextUtterance(); | 26 std::string GetNextUtterance(); |
27 | 27 |
28 // Wait for next utterance and return true if next utterance is ChromeVox | 28 // Wait for next utterance and return true if next utterance is ChromeVox |
29 // enabled message. | 29 // enabled message. |
30 bool SkipChromeVoxEnabledMessage(); | 30 bool SkipChromeVoxEnabledMessage(); |
| 31 bool SkipChromeVoxMessage(const std::string& message); |
31 | 32 |
32 // TtsPlatformImpl implementation. | 33 // TtsPlatformImpl implementation. |
33 bool PlatformImplAvailable() override; | 34 bool PlatformImplAvailable() override; |
34 bool Speak(int utterance_id, | 35 bool Speak(int utterance_id, |
35 const std::string& utterance, | 36 const std::string& utterance, |
36 const std::string& lang, | 37 const std::string& lang, |
37 const VoiceData& voice, | 38 const VoiceData& voice, |
38 const UtteranceContinuousParameters& params) override; | 39 const UtteranceContinuousParameters& params) override; |
39 bool StopSpeaking() override; | 40 bool StopSpeaking() override; |
40 bool IsSpeaking() override; | 41 bool IsSpeaking() override; |
41 void GetVoices(std::vector<VoiceData>* out_voices) override; | 42 void GetVoices(std::vector<VoiceData>* out_voices) override; |
42 void Pause() override {} | 43 void Pause() override {} |
43 void Resume() override {} | 44 void Resume() override {} |
44 std::string error() override; | 45 std::string error() override; |
45 void clear_error() override {} | 46 void clear_error() override {} |
46 void set_error(const std::string& error) override {} | 47 void set_error(const std::string& error) override {} |
47 void WillSpeakUtteranceWithVoice(const Utterance* utterance, | 48 void WillSpeakUtteranceWithVoice(const Utterance* utterance, |
48 const VoiceData& voice_data) override; | 49 const VoiceData& voice_data) override; |
49 | 50 |
50 private: | 51 private: |
51 scoped_refptr<content::MessageLoopRunner> loop_runner_; | 52 scoped_refptr<content::MessageLoopRunner> loop_runner_; |
52 std::deque<std::string> utterance_queue_; | 53 std::deque<std::string> utterance_queue_; |
53 | 54 |
54 DISALLOW_COPY_AND_ASSIGN(SpeechMonitor); | 55 DISALLOW_COPY_AND_ASSIGN(SpeechMonitor); |
55 }; | 56 }; |
56 | 57 |
57 } // namespace chromeos | 58 } // namespace chromeos |
58 | 59 |
59 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SPEECH_MONITOR_H_ | 60 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SPEECH_MONITOR_H_ |
OLD | NEW |