| 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 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 // Speak the given utterance. If the utterance's can_enqueue flag is true | 141 // Speak the given utterance. If the utterance's can_enqueue flag is true |
| 142 // and another utterance is in progress, adds it to the end of the queue. | 142 // and another utterance is in progress, adds it to the end of the queue. |
| 143 // Otherwise, interrupts any current utterance and speaks this one | 143 // Otherwise, interrupts any current utterance and speaks this one |
| 144 // immediately. | 144 // immediately. |
| 145 void SpeakOrEnqueue(Utterance* utterance); | 145 void SpeakOrEnqueue(Utterance* utterance); |
| 146 | 146 |
| 147 // Stop all utterances and flush the queue. | 147 // Stop all utterances and flush the queue. |
| 148 void Stop(); | 148 void Stop(); |
| 149 | 149 |
| 150 // Called when an extension finishes speaking an utterance. | 150 // Called when an extension finishes speaking an utterance. |
| 151 void OnSpeechFinished(int request_id, std::string error_message); | 151 void OnSpeechFinished(int request_id, const std::string& error_message); |
| 152 | 152 |
| 153 // For unit testing. | 153 // For unit testing. |
| 154 void SetPlatformImpl(ExtensionTtsPlatformImpl* platform_impl); | 154 void SetPlatformImpl(ExtensionTtsPlatformImpl* platform_impl); |
| 155 | 155 |
| 156 private: | 156 private: |
| 157 ExtensionTtsController(); | 157 ExtensionTtsController(); |
| 158 virtual ~ExtensionTtsController(); | 158 virtual ~ExtensionTtsController(); |
| 159 | 159 |
| 160 // Get the platform TTS implementation (or injected mock). | 160 // Get the platform TTS implementation (or injected mock). |
| 161 ExtensionTtsPlatformImpl* GetPlatformImpl(); | 161 ExtensionTtsPlatformImpl* GetPlatformImpl(); |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 }; | 227 }; |
| 228 | 228 |
| 229 class ExtensionTtsSpeakCompletedFunction : public SyncExtensionFunction { | 229 class ExtensionTtsSpeakCompletedFunction : public SyncExtensionFunction { |
| 230 private: | 230 private: |
| 231 ~ExtensionTtsSpeakCompletedFunction() {} | 231 ~ExtensionTtsSpeakCompletedFunction() {} |
| 232 virtual bool RunImpl(); | 232 virtual bool RunImpl(); |
| 233 DECLARE_EXTENSION_FUNCTION_NAME("experimental.tts.speakCompleted") | 233 DECLARE_EXTENSION_FUNCTION_NAME("experimental.tts.speakCompleted") |
| 234 }; | 234 }; |
| 235 | 235 |
| 236 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TTS_API_H_ | 236 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_TTS_API_H_ |
| OLD | NEW |