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 CONTENT_EXPORT SpeechRecognitionRequest(net::URLRequestContextGetter* context, | 44 CONTENT_EXPORT SpeechRecognitionRequest(net::URLRequestContextGetter* context, |
45 Delegate* delegate); | 45 Delegate* delegate); |
46 | 46 |
47 CONTENT_EXPORT virtual ~SpeechRecognitionRequest(); | 47 CONTENT_EXPORT 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 CONTENT_EXPORT void Start(const std::string& language, | 52 CONTENT_EXPORT void Start(const std::string& language, |
53 const std::string& grammar, | 53 const std::string& grammar, |
54 bool censor_results, | 54 bool filter_profanities, |
55 const std::string& hardware_info, | 55 const std::string& hardware_info, |
56 const std::string& origin_url, | 56 const std::string& origin_url, |
57 const std::string& content_type); | 57 const std::string& content_type); |
58 | 58 |
59 // Send a single chunk of audio immediately to the server. | 59 // Send a single chunk of audio immediately to the server. |
60 CONTENT_EXPORT void UploadAudioChunk(const std::string& audio_data, | 60 CONTENT_EXPORT void UploadAudioChunk(const std::string& audio_data, |
61 bool is_last_chunk); | 61 bool is_last_chunk); |
62 | 62 |
63 CONTENT_EXPORT bool HasPendingRequest() { return url_fetcher_ != NULL; } | 63 CONTENT_EXPORT bool HasPendingRequest() { return url_fetcher_ != NULL; } |
64 | 64 |
(...skipping 10 matching lines...) Expand all Loading... |
75 | 75 |
76 // This typedef is to workaround the issue with certain versions of | 76 // This typedef is to workaround the issue with certain versions of |
77 // Visual Studio where it gets confused between multiple Delegate | 77 // Visual Studio where it gets confused between multiple Delegate |
78 // classes and gives a C2500 error. (I saw this error on the try bots - | 78 // classes and gives a C2500 error. (I saw this error on the try bots - |
79 // the workaround was not needed for my machine). | 79 // the workaround was not needed for my machine). |
80 typedef SpeechRecognitionRequest::Delegate SpeechRecognitionRequestDelegate; | 80 typedef SpeechRecognitionRequest::Delegate SpeechRecognitionRequestDelegate; |
81 | 81 |
82 } // namespace speech_input | 82 } // namespace speech_input |
83 | 83 |
84 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ | 84 #endif // CONTENT_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ |
OLD | NEW |