OLD | NEW |
1 // Copyright (c) 2010 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 | 8 |
8 #include <string> | 9 #include <string> |
9 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
10 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
11 #include "base/scoped_ptr.h" | 12 #include "base/scoped_ptr.h" |
12 #include "chrome/common/net/url_fetcher.h" | 13 #include "chrome/common/net/url_fetcher.h" |
13 #include "chrome/common/speech_input_result.h" | 14 #include "chrome/common/speech_input_result.h" |
14 #include "googleurl/src/gurl.h" | 15 #include "googleurl/src/gurl.h" |
15 | 16 |
16 class URLFetcher; | 17 class URLFetcher; |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
48 const std::string& grammar, | 49 const std::string& grammar, |
49 const std::string& hardware_info, | 50 const std::string& hardware_info, |
50 const std::string& content_type, | 51 const std::string& content_type, |
51 const std::string& audio_data); | 52 const std::string& audio_data); |
52 | 53 |
53 bool HasPendingRequest() { return url_fetcher_ != NULL; } | 54 bool HasPendingRequest() { return url_fetcher_ != NULL; } |
54 | 55 |
55 // URLFetcher::Delegate methods. | 56 // URLFetcher::Delegate methods. |
56 virtual void OnURLFetchComplete(const URLFetcher* source, | 57 virtual void OnURLFetchComplete(const URLFetcher* source, |
57 const GURL& url, | 58 const GURL& url, |
58 const URLRequestStatus& status, | 59 const net::URLRequestStatus& status, |
59 int response_code, | 60 int response_code, |
60 const ResponseCookies& cookies, | 61 const ResponseCookies& cookies, |
61 const std::string& data); | 62 const std::string& data); |
62 | 63 |
63 private: | 64 private: |
64 scoped_refptr<URLRequestContextGetter> url_context_; | 65 scoped_refptr<URLRequestContextGetter> url_context_; |
65 Delegate* delegate_; | 66 Delegate* delegate_; |
66 scoped_ptr<URLFetcher> url_fetcher_; | 67 scoped_ptr<URLFetcher> url_fetcher_; |
67 | 68 |
68 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionRequest); | 69 DISALLOW_COPY_AND_ASSIGN(SpeechRecognitionRequest); |
69 }; | 70 }; |
70 | 71 |
71 // This typedef is to workaround the issue with certain versions of | 72 // This typedef is to workaround the issue with certain versions of |
72 // Visual Studio where it gets confused between multiple Delegate | 73 // Visual Studio where it gets confused between multiple Delegate |
73 // classes and gives a C2500 error. (I saw this error on the try bots - | 74 // classes and gives a C2500 error. (I saw this error on the try bots - |
74 // the workaround was not needed for my machine). | 75 // the workaround was not needed for my machine). |
75 typedef SpeechRecognitionRequest::Delegate SpeechRecognitionRequestDelegate; | 76 typedef SpeechRecognitionRequest::Delegate SpeechRecognitionRequestDelegate; |
76 | 77 |
77 } // namespace speech_input | 78 } // namespace speech_input |
78 | 79 |
79 #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ | 80 #endif // CHROME_BROWSER_SPEECH_SPEECH_RECOGNITION_REQUEST_H_ |
OLD | NEW |