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 #include "content/browser/speech/speech_recognizer.h" | 5 #include "content/browser/speech/speech_recognizer.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/time.h" | 8 #include "base/time.h" |
9 #include "content/public/browser/browser_thread.h" | 9 #include "content/public/browser/browser_thread.h" |
10 #include "net/url_request/url_request_context_getter.h" | 10 #include "net/url_request/url_request_context_getter.h" |
11 | 11 |
| 12 using content::BrowserThread; |
12 using media::AudioInputController; | 13 using media::AudioInputController; |
13 using std::string; | 14 using std::string; |
14 | 15 |
15 namespace { | 16 namespace { |
16 | 17 |
17 // The following constants are related to the volume level indicator shown in | 18 // The following constants are related to the volume level indicator shown in |
18 // the UI for recorded audio. | 19 // the UI for recorded audio. |
19 // Multiplier used when new volume is greater than previous level. | 20 // Multiplier used when new volume is greater than previous level. |
20 const float kUpSmoothingFactor = 1.0f; | 21 const float kUpSmoothingFactor = 1.0f; |
21 // Multiplier used when new volume is lesser than previous level. | 22 // Multiplier used when new volume is lesser than previous level. |
(...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
298 SpeechInputError error) { | 299 SpeechInputError error) { |
299 DCHECK_NE(error, kErrorNone); | 300 DCHECK_NE(error, kErrorNone); |
300 CancelRecognition(); | 301 CancelRecognition(); |
301 | 302 |
302 // Guard against the delegate freeing us until we finish our job. | 303 // Guard against the delegate freeing us until we finish our job. |
303 scoped_refptr<SpeechRecognizer> me(this); | 304 scoped_refptr<SpeechRecognizer> me(this); |
304 delegate_->OnRecognizerError(caller_id_, error); | 305 delegate_->OnRecognizerError(caller_id_, error); |
305 } | 306 } |
306 | 307 |
307 } // namespace speech_input | 308 } // namespace speech_input |
OLD | NEW |