| 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 #include "chrome/browser/speech/speech_recognizer.h" | 5 #include "chrome/browser/speech/speech_recognizer.h" |
| 6 | 6 |
| 7 #include "base/ref_counted.h" | 7 #include "base/ref_counted.h" |
| 8 #include "base/scoped_ptr.h" | 8 #include "base/scoped_ptr.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/browser/browser_thread.h" | 10 #include "chrome/browser/browser_thread.h" |
| 11 #include "chrome/browser/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 #include "chrome/common/net/url_request_context_getter.h" | 12 #include "chrome/common/net/url_request_context_getter.h" |
| 13 #include "third_party/speex/include/speex/speex.h" | 13 #include "third_party/speex/include/speex/speex.h" |
| 14 | 14 |
| 15 using media::AudioInputController; | 15 using media::AudioInputController; |
| 16 using std::list; | 16 using std::list; |
| 17 using std::string; | 17 using std::string; |
| 18 | 18 |
| 19 namespace { | 19 namespace { |
| 20 const char* const kContentTypeSpeex = | 20 const char* const kContentTypeSpeex = |
| 21 "audio/x-speex-with-header-byte; rate=16000"; | 21 "audio/x-speex-with-header-byte; rate=16000"; |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 334 | 334 |
| 335 void SpeechRecognizer::InformErrorAndCancelRecognition(ErrorCode error) { | 335 void SpeechRecognizer::InformErrorAndCancelRecognition(ErrorCode error) { |
| 336 CancelRecognition(); | 336 CancelRecognition(); |
| 337 | 337 |
| 338 // Guard against the delegate freeing us until we finish our job. | 338 // Guard against the delegate freeing us until we finish our job. |
| 339 scoped_refptr<SpeechRecognizer> me(this); | 339 scoped_refptr<SpeechRecognizer> me(this); |
| 340 delegate_->OnRecognizerError(caller_id_, error); | 340 delegate_->OnRecognizerError(caller_id_, error); |
| 341 } | 341 } |
| 342 | 342 |
| 343 } // namespace speech_input | 343 } // namespace speech_input |
| OLD | NEW |