| 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_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ | 5 #ifndef CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ |
| 6 #define CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ | 6 #define CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "base/ref_counted.h" | 10 #include "base/ref_counted.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 | 37 |
| 38 // |url| is the server address to which the request wil be sent. | 38 // |url| is the server address to which the request wil be sent. |
| 39 SpeechRecognitionRequest(URLRequestContextGetter* context, | 39 SpeechRecognitionRequest(URLRequestContextGetter* context, |
| 40 Delegate* delegate); | 40 Delegate* delegate); |
| 41 | 41 |
| 42 virtual ~SpeechRecognitionRequest(); | 42 virtual ~SpeechRecognitionRequest(); |
| 43 | 43 |
| 44 // Sends a new request with the given audio data, returns true if successful. | 44 // Sends a new request with the given audio data, returns true if successful. |
| 45 // The same object can be used to send multiple requests but only after the | 45 // The same object can be used to send multiple requests but only after the |
| 46 // previous request has completed. | 46 // previous request has completed. |
| 47 bool Send(const std::string& grammar, | 47 bool Send(const std::string& language, |
| 48 const std::string& grammar, |
| 48 const std::string& content_type, | 49 const std::string& content_type, |
| 49 const std::string& audio_data); | 50 const std::string& audio_data); |
| 50 | 51 |
| 51 bool HasPendingRequest() { return url_fetcher_ != NULL; } | 52 bool HasPendingRequest() { return url_fetcher_ != NULL; } |
| 52 | 53 |
| 53 // URLFetcher::Delegate methods. | 54 // URLFetcher::Delegate methods. |
| 54 void OnURLFetchComplete(const URLFetcher* source, | 55 void OnURLFetchComplete(const URLFetcher* source, |
| 55 const GURL& url, | 56 const GURL& url, |
| 56 const URLRequestStatus& status, | 57 const URLRequestStatus& status, |
| 57 int response_code, | 58 int response_code, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 68 | 69 |
| 69 // This typedef is to workaround the issue with certain versions of | 70 // This typedef is to workaround the issue with certain versions of |
| 70 // Visual Studio where it gets confused between multiple Delegate | 71 // Visual Studio where it gets confused between multiple Delegate |
| 71 // classes and gives a C2500 error. (I saw this error on the try bots - | 72 // classes and gives a C2500 error. (I saw this error on the try bots - |
| 72 // the workaround was not needed for my machine). | 73 // the workaround was not needed for my machine). |
| 73 typedef SpeechRecognitionRequest::Delegate SpeechRecognitionRequestDelegate; | 74 typedef SpeechRecognitionRequest::Delegate SpeechRecognitionRequestDelegate; |
| 74 | 75 |
| 75 } // namespace speech_input | 76 } // namespace speech_input |
| 76 | 77 |
| 77 #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ | 78 #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ |
| OLD | NEW |