OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ | 5 #ifndef CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ |
6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ | 6 #define CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 SpeechRecognitionRequest(net::URLRequestContextGetter* context, | 44 SpeechRecognitionRequest(net::URLRequestContextGetter* context, |
45 Delegate* delegate); | 45 Delegate* delegate); |
46 | 46 |
47 virtual ~SpeechRecognitionRequest(); | 47 virtual ~SpeechRecognitionRequest(); |
48 | 48 |
49 // Sends a new request with the given audio data, returns true if successful. | 49 // Sends a new request with the given audio data, returns true if successful. |
50 // The same object can be used to send multiple requests but only after the | 50 // The same object can be used to send multiple requests but only after the |
51 // previous request has completed. | 51 // previous request has completed. |
52 void Start(const std::string& language, | 52 void Start(const std::string& language, |
53 const std::string& grammar, | 53 const std::string& grammar, |
| 54 bool censor_results, |
54 const std::string& hardware_info, | 55 const std::string& hardware_info, |
55 const std::string& origin_url, | 56 const std::string& origin_url, |
56 const std::string& content_type); | 57 const std::string& content_type); |
57 | 58 |
58 // Send a single chunk of audio immediately to the server. | 59 // Send a single chunk of audio immediately to the server. |
59 void UploadAudioChunk(const std::string& audio_data, bool is_last_chunk); | 60 void UploadAudioChunk(const std::string& audio_data, bool is_last_chunk); |
60 | 61 |
61 bool HasPendingRequest() { return url_fetcher_ != NULL; } | 62 bool HasPendingRequest() { return url_fetcher_ != NULL; } |
62 | 63 |
63 // URLFetcher::Delegate methods. | 64 // URLFetcher::Delegate methods. |
(...skipping 14 matching lines...) Expand all Loading... |
78 | 79 |
79 // This typedef is to workaround the issue with certain versions of | 80 // This typedef is to workaround the issue with certain versions of |
80 // Visual Studio where it gets confused between multiple Delegate | 81 // Visual Studio where it gets confused between multiple Delegate |
81 // classes and gives a C2500 error. (I saw this error on the try bots - | 82 // classes and gives a C2500 error. (I saw this error on the try bots - |
82 // the workaround was not needed for my machine). | 83 // the workaround was not needed for my machine). |
83 typedef SpeechRecognitionRequest::Delegate SpeechRecognitionRequestDelegate; | 84 typedef SpeechRecognitionRequest::Delegate SpeechRecognitionRequestDelegate; |
84 | 85 |
85 } // namespace speech_input | 86 } // namespace speech_input |
86 | 87 |
87 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ | 88 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ |
OLD | NEW |