| 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 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 // previous request has completed. | 46 // previous request has completed. |
| 47 bool Send(const std::string& language, | 47 bool Send(const std::string& language, |
| 48 const std::string& grammar, | 48 const std::string& grammar, |
| 49 const std::string& hardware_info, | 49 const std::string& hardware_info, |
| 50 const std::string& content_type, | 50 const std::string& content_type, |
| 51 const std::string& audio_data); | 51 const std::string& audio_data); |
| 52 | 52 |
| 53 bool HasPendingRequest() { return url_fetcher_ != NULL; } | 53 bool HasPendingRequest() { return url_fetcher_ != NULL; } |
| 54 | 54 |
| 55 // URLFetcher::Delegate methods. | 55 // URLFetcher::Delegate methods. |
| 56 void OnURLFetchComplete(const URLFetcher* source, | 56 virtual void OnURLFetchComplete(const URLFetcher* source, |
| 57 const GURL& url, | 57 const GURL& url, |
| 58 const URLRequestStatus& status, | 58 const URLRequestStatus& status, |
| 59 int response_code, | 59 int response_code, |
| 60 const ResponseCookies& cookies, | 60 const ResponseCookies& cookies, |
| 61 const std::string& data); | 61 const std::string& data); |
| 62 | 62 |
| 63 private: | 63 private: |
| 64 scoped_refptr<URLRequestContextGetter> url_context_; | 64 scoped_refptr<URLRequestContextGetter> url_context_; |
| 65 Delegate* delegate_; | 65 Delegate* delegate_; |
| 66 scoped_ptr<URLFetcher> url_fetcher_; | 66 scoped_ptr<URLFetcher> url_fetcher_; |
| 67 | 67 |
| 68 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionRequest); | 68 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionRequest); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 // This typedef is to workaround the issue with certain versions of | 71 // This typedef is to workaround the issue with certain versions of |
| 72 // Visual Studio where it gets confused between multiple Delegate | 72 // Visual Studio where it gets confused between multiple Delegate |
| 73 // classes and gives a C2500 error. (I saw this error on the try bots - | 73 // classes and gives a C2500 error. (I saw this error on the try bots - |
| 74 // the workaround was not needed for my machine). | 74 // the workaround was not needed for my machine). |
| 75 typedef SpeechRecognitionRequest::Delegate SpeechRecognitionRequestDelegate; | 75 typedef SpeechRecognitionRequest::Delegate SpeechRecognitionRequestDelegate; |
| 76 | 76 |
| 77 } // namespace speech_input | 77 } // namespace speech_input |
| 78 | 78 |
| 79 #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ | 79 #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ |
| OLD | NEW |