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_SPEECH_TTS_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_SPEECH_TTS_CONTROLLER_IMPL_H_ |
6 #define CHROME_BROWSER_SPEECH_TTS_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_SPEECH_TTS_CONTROLLER_IMPL_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 11 matching lines...) Expand all Loading... |
22 | 22 |
23 // Singleton class that manages text-to-speech for the TTS and TTS engine | 23 // Singleton class that manages text-to-speech for the TTS and TTS engine |
24 // extension APIs, maintaining a queue of pending utterances and keeping | 24 // extension APIs, maintaining a queue of pending utterances and keeping |
25 // track of all state. | 25 // track of all state. |
26 class TtsControllerImpl : public TtsController { | 26 class TtsControllerImpl : public TtsController { |
27 public: | 27 public: |
28 // Get the single instance of this class. | 28 // Get the single instance of this class. |
29 static TtsControllerImpl* GetInstance(); | 29 static TtsControllerImpl* GetInstance(); |
30 | 30 |
31 // TtsController methods | 31 // TtsController methods |
32 virtual bool IsSpeaking() OVERRIDE; | 32 virtual bool IsSpeaking() override; |
33 virtual void SpeakOrEnqueue(Utterance* utterance) OVERRIDE; | 33 virtual void SpeakOrEnqueue(Utterance* utterance) override; |
34 virtual void Stop() OVERRIDE; | 34 virtual void Stop() override; |
35 virtual void Pause() OVERRIDE; | 35 virtual void Pause() override; |
36 virtual void Resume() OVERRIDE; | 36 virtual void Resume() override; |
37 virtual void OnTtsEvent(int utterance_id, | 37 virtual void OnTtsEvent(int utterance_id, |
38 TtsEventType event_type, | 38 TtsEventType event_type, |
39 int char_index, | 39 int char_index, |
40 const std::string& error_message) OVERRIDE; | 40 const std::string& error_message) override; |
41 virtual void GetVoices(content::BrowserContext* browser_context, | 41 virtual void GetVoices(content::BrowserContext* browser_context, |
42 std::vector<VoiceData>* out_voices) OVERRIDE; | 42 std::vector<VoiceData>* out_voices) override; |
43 virtual void VoicesChanged() OVERRIDE; | 43 virtual void VoicesChanged() override; |
44 virtual void AddVoicesChangedDelegate( | 44 virtual void AddVoicesChangedDelegate( |
45 VoicesChangedDelegate* delegate) OVERRIDE; | 45 VoicesChangedDelegate* delegate) override; |
46 virtual void RemoveVoicesChangedDelegate( | 46 virtual void RemoveVoicesChangedDelegate( |
47 VoicesChangedDelegate* delegate) OVERRIDE; | 47 VoicesChangedDelegate* delegate) override; |
48 virtual void SetTtsEngineDelegate(TtsEngineDelegate* delegate) OVERRIDE; | 48 virtual void SetTtsEngineDelegate(TtsEngineDelegate* delegate) override; |
49 virtual TtsEngineDelegate* GetTtsEngineDelegate() OVERRIDE; | 49 virtual TtsEngineDelegate* GetTtsEngineDelegate() override; |
50 virtual void SetPlatformImpl(TtsPlatformImpl* platform_impl) OVERRIDE; | 50 virtual void SetPlatformImpl(TtsPlatformImpl* platform_impl) override; |
51 virtual int QueueSize() OVERRIDE; | 51 virtual int QueueSize() override; |
52 | 52 |
53 protected: | 53 protected: |
54 TtsControllerImpl(); | 54 TtsControllerImpl(); |
55 virtual ~TtsControllerImpl(); | 55 virtual ~TtsControllerImpl(); |
56 | 56 |
57 private: | 57 private: |
58 // Get the platform TTS implementation (or injected mock). | 58 // Get the platform TTS implementation (or injected mock). |
59 TtsPlatformImpl* GetPlatformImpl(); | 59 TtsPlatformImpl* GetPlatformImpl(); |
60 | 60 |
61 // Start speaking the given utterance. Will either take ownership of | 61 // Start speaking the given utterance. Will either take ownership of |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
95 // dependency injection. | 95 // dependency injection. |
96 TtsPlatformImpl* platform_impl_; | 96 TtsPlatformImpl* platform_impl_; |
97 | 97 |
98 // The delegate that processes TTS requests with user-installed extensions. | 98 // The delegate that processes TTS requests with user-installed extensions. |
99 TtsEngineDelegate* tts_engine_delegate_; | 99 TtsEngineDelegate* tts_engine_delegate_; |
100 | 100 |
101 DISALLOW_COPY_AND_ASSIGN(TtsControllerImpl); | 101 DISALLOW_COPY_AND_ASSIGN(TtsControllerImpl); |
102 }; | 102 }; |
103 | 103 |
104 #endif // CHROME_BROWSER_SPEECH_TTS_CONTROLLER_IMPL_H_ | 104 #endif // CHROME_BROWSER_SPEECH_TTS_CONTROLLER_IMPL_H_ |
OLD | NEW |