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