Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(115)

Side by Side Diff: chrome/browser/chromeos/accessibility/speech_monitor.h

Issue 2698273002: Select-to-speak: Stop speech when tapping Search or Control (Closed)
Patch Set: Trigger on tap and release of Search or Control Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 12 matching lines...) Expand all
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 bool SkipChromeVoxMessage(const std::string& message);
32 32
33 // Returns true if StopSpeaking() was called on TtsController.
34 bool DidStop();
35
36 private:
33 // TtsPlatformImpl implementation. 37 // TtsPlatformImpl implementation.
34 bool PlatformImplAvailable() override; 38 bool PlatformImplAvailable() override;
35 bool Speak(int utterance_id, 39 bool Speak(int utterance_id,
36 const std::string& utterance, 40 const std::string& utterance,
37 const std::string& lang, 41 const std::string& lang,
38 const VoiceData& voice, 42 const VoiceData& voice,
39 const UtteranceContinuousParameters& params) override; 43 const UtteranceContinuousParameters& params) override;
40 bool StopSpeaking() override; 44 bool StopSpeaking() override;
41 bool IsSpeaking() override; 45 bool IsSpeaking() override;
42 void GetVoices(std::vector<VoiceData>* out_voices) override; 46 void GetVoices(std::vector<VoiceData>* out_voices) override;
43 void Pause() override {} 47 void Pause() override {}
44 void Resume() override {} 48 void Resume() override {}
45 std::string error() override; 49 std::string error() override;
46 void clear_error() override {} 50 void clear_error() override {}
47 void set_error(const std::string& error) override {} 51 void set_error(const std::string& error) override {}
48 void WillSpeakUtteranceWithVoice(const Utterance* utterance, 52 void WillSpeakUtteranceWithVoice(const Utterance* utterance,
49 const VoiceData& voice_data) override; 53 const VoiceData& voice_data) override;
50 54
51 private:
52 scoped_refptr<content::MessageLoopRunner> loop_runner_; 55 scoped_refptr<content::MessageLoopRunner> loop_runner_;
53 std::deque<std::string> utterance_queue_; 56 std::deque<std::string> utterance_queue_;
57 bool did_stop_ = false;
54 58
55 DISALLOW_COPY_AND_ASSIGN(SpeechMonitor); 59 DISALLOW_COPY_AND_ASSIGN(SpeechMonitor);
56 }; 60 };
57 61
58 } // namespace chromeos 62 } // namespace chromeos
59 63
60 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SPEECH_MONITOR_H_ 64 #endif // CHROME_BROWSER_CHROMEOS_ACCESSIBILITY_SPEECH_MONITOR_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698