Revert of Add button to add new FSP services to Files app. (patchset #8 id:140001...
[chromium-blink-merge.git] / chrome / browser / chromeos / accessibility / speech_monitor.h
blobf7bbf3b8495a93741b345981e284169305a0707f
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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SPEECH_MONITOR_H_
6 #define CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SPEECH_MONITOR_H_
8 #include <deque>
10 #include "base/memory/ref_counted.h"
11 #include "chrome/browser/speech/tts_platform.h"
12 #include "content/public/test/test_utils.h"
14 namespace chromeos {
16 // For testing purpose installs itself as the platform speech synthesis engine,
17 // allowing it to intercept all speech calls, and then provides a method to
18 // block until the next utterance is spoken.
19 class SpeechMonitor : public TtsPlatformImpl {
20 public:
21 SpeechMonitor();
22 ~SpeechMonitor() override;
24 // Blocks until the next utterance is spoken, and returns its text.
25 std::string GetNextUtterance();
27 // Wait for next utterance and return true if next utterance is ChromeVox
28 // enabled message.
29 bool SkipChromeVoxEnabledMessage();
31 // TtsPlatformImpl implementation.
32 bool PlatformImplAvailable() override;
33 bool Speak(int utterance_id,
34 const std::string& utterance,
35 const std::string& lang,
36 const VoiceData& voice,
37 const UtteranceContinuousParameters& params) override;
38 bool StopSpeaking() override;
39 bool IsSpeaking() override;
40 void GetVoices(std::vector<VoiceData>* out_voices) override;
41 void Pause() override {}
42 void Resume() override {}
43 std::string error() override;
44 void clear_error() override {}
45 void set_error(const std::string& error) override {}
46 void WillSpeakUtteranceWithVoice(const Utterance* utterance,
47 const VoiceData& voice_data) override;
49 private:
50 scoped_refptr<content::MessageLoopRunner> loop_runner_;
51 std::deque<std::string> utterance_queue_;
53 DISALLOW_COPY_AND_ASSIGN(SpeechMonitor);
56 } // namespace chromeos
58 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SPEECH_MONITOR_H_