OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_EXTENSIONS_EXTENSION_TTS_API_H_ | 5 #ifndef CHROME_BROWSER_EXTENSIONS_EXTENSION_TTS_API_H_ |
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TTS_API_H_ | 6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_TTS_API_H_ |
7 | 7 |
8 #include <queue> | 8 #include <queue> |
9 | 9 |
10 #include "base/singleton.h" | 10 #include "base/singleton.h" |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
90 void SpeakOrEnqueue(Utterance* utterance, bool can_enqueue); | 90 void SpeakOrEnqueue(Utterance* utterance, bool can_enqueue); |
91 | 91 |
92 // Stop all utterances and flush the queue. | 92 // Stop all utterances and flush the queue. |
93 void Stop(); | 93 void Stop(); |
94 | 94 |
95 // For unit testing. | 95 // For unit testing. |
96 void SetPlatformImpl(ExtensionTtsPlatformImpl* platform_impl); | 96 void SetPlatformImpl(ExtensionTtsPlatformImpl* platform_impl); |
97 | 97 |
98 private: | 98 private: |
99 ExtensionTtsController(); | 99 ExtensionTtsController(); |
100 virtual ~ExtensionTtsController() {} | 100 virtual ~ExtensionTtsController(); |
101 | 101 |
102 // Get the platform TTS implementation (or injected mock). | 102 // Get the platform TTS implementation (or injected mock). |
103 ExtensionTtsPlatformImpl* GetPlatformImpl(); | 103 ExtensionTtsPlatformImpl* GetPlatformImpl(); |
104 | 104 |
105 // Start speaking the given utterance. Will either take ownership of | 105 // Start speaking the given utterance. Will either take ownership of |
106 // |utterance| or delete it if there's an error. | 106 // |utterance| or delete it if there's an error. |
107 void SpeakNow(Utterance* utterance); | 107 void SpeakNow(Utterance* utterance); |
108 | 108 |
109 // Called periodically when speech is ongoing. Checks to see if the | 109 // Called periodically when speech is ongoing. Checks to see if the |
110 // underlying platform speech system has finished the current utterance, | 110 // underlying platform speech system has finished the current utterance, |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
154 }; | 154 }; |
155 | 155 |
156 class ExtensionTtsIsSpeakingFunction : public SyncExtensionFunction { | 156 class ExtensionTtsIsSpeakingFunction : public SyncExtensionFunction { |
157 private: | 157 private: |
158 ~ExtensionTtsIsSpeakingFunction() {} | 158 ~ExtensionTtsIsSpeakingFunction() {} |
159 virtual bool RunImpl(); | 159 virtual bool RunImpl(); |
160 DECLARE_EXTENSION_FUNCTION_NAME("experimental.tts.isSpeaking") | 160 DECLARE_EXTENSION_FUNCTION_NAME("experimental.tts.isSpeaking") |
161 }; | 161 }; |
162 | 162 |
163 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TTS_API_H_ | 163 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TTS_API_H_ |
OLD | NEW |