OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 #include "chrome/renderer/tts_dispatcher.h" | 5 #include "chrome/renderer/tts_dispatcher.h" |
6 | 6 |
7 #include "base/basictypes.h" | 7 #include <stddef.h> |
| 8 |
8 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
9 #include "chrome/common/tts_messages.h" | 10 #include "chrome/common/tts_messages.h" |
10 #include "chrome/common/tts_utterance_request.h" | 11 #include "chrome/common/tts_utterance_request.h" |
11 #include "content/public/renderer/render_thread.h" | 12 #include "content/public/renderer/render_thread.h" |
12 #include "third_party/WebKit/public/platform/WebCString.h" | 13 #include "third_party/WebKit/public/platform/WebCString.h" |
13 #include "third_party/WebKit/public/platform/WebSpeechSynthesisUtterance.h" | 14 #include "third_party/WebKit/public/platform/WebSpeechSynthesisUtterance.h" |
14 #include "third_party/WebKit/public/platform/WebSpeechSynthesisVoice.h" | 15 #include "third_party/WebKit/public/platform/WebSpeechSynthesisVoice.h" |
15 #include "third_party/WebKit/public/platform/WebString.h" | 16 #include "third_party/WebKit/public/platform/WebString.h" |
16 #include "third_party/WebKit/public/platform/WebVector.h" | 17 #include "third_party/WebKit/public/platform/WebVector.h" |
17 | 18 |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
191 void TtsDispatcher::OnSpeakingErrorOccurred(int utterance_id, | 192 void TtsDispatcher::OnSpeakingErrorOccurred(int utterance_id, |
192 const std::string& error_message) { | 193 const std::string& error_message) { |
193 WebSpeechSynthesisUtterance utterance = FindUtterance(utterance_id); | 194 WebSpeechSynthesisUtterance utterance = FindUtterance(utterance_id); |
194 if (utterance.isNull()) | 195 if (utterance.isNull()) |
195 return; | 196 return; |
196 | 197 |
197 // The web speech API doesn't support an error message. | 198 // The web speech API doesn't support an error message. |
198 synthesizer_client_->speakingErrorOccurred(utterance); | 199 synthesizer_client_->speakingErrorOccurred(utterance); |
199 utterance_id_map_.erase(utterance_id); | 200 utterance_id_map_.erase(utterance_id); |
200 } | 201 } |
OLD | NEW |