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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |
65 // content::URLFetcherDelegate methods. | 65 // content::URLFetcherDelegate methods. |
66 virtual void OnURLFetchComplete(const URLFetcher* source) OVERRIDE; | 66 virtual void OnURLFetchComplete(const content::URLFetcher* source) OVERRIDE; |
67 | 67 |
68 private: | 68 private: |
69 scoped_refptr<net::URLRequestContextGetter> url_context_; | 69 scoped_refptr<net::URLRequestContextGetter> url_context_; |
70 Delegate* delegate_; | 70 Delegate* delegate_; |
71 scoped_ptr<URLFetcher> url_fetcher_; | 71 scoped_ptr<content::URLFetcher> url_fetcher_; |
72 | 72 |
73 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionRequest); | 73 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionRequest); |
74 }; | 74 }; |
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 |