OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_recognition_manager_impl.h" | 5 #include "content/browser/speech/speech_recognition_manager_impl.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "content/browser/browser_main_loop.h" | 8 #include "content/browser/browser_main_loop.h" |
9 #include "content/browser/renderer_host/media/media_stream_manager.h" | 9 #include "content/browser/renderer_host/media/media_stream_manager.h" |
10 #include "content/browser/speech/google_one_shot_remote_engine.h" | 10 #include "content/browser/speech/google_one_shot_remote_engine.h" |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 remote_engine_config.language = config.language; | 93 remote_engine_config.language = config.language; |
94 remote_engine_config.grammars = config.grammars; | 94 remote_engine_config.grammars = config.grammars; |
95 remote_engine_config.audio_sample_rate = SpeechRecognizer::kAudioSampleRate; | 95 remote_engine_config.audio_sample_rate = SpeechRecognizer::kAudioSampleRate; |
96 remote_engine_config.audio_num_bits_per_sample = | 96 remote_engine_config.audio_num_bits_per_sample = |
97 SpeechRecognizer::kNumBitsPerAudioSample; | 97 SpeechRecognizer::kNumBitsPerAudioSample; |
98 remote_engine_config.filter_profanities = config.filter_profanities; | 98 remote_engine_config.filter_profanities = config.filter_profanities; |
99 remote_engine_config.continuous = config.continuous; | 99 remote_engine_config.continuous = config.continuous; |
100 remote_engine_config.interim_results = config.interim_results; | 100 remote_engine_config.interim_results = config.interim_results; |
101 remote_engine_config.max_hypotheses = config.max_hypotheses; | 101 remote_engine_config.max_hypotheses = config.max_hypotheses; |
102 remote_engine_config.hardware_info = hardware_info; | 102 remote_engine_config.hardware_info = hardware_info; |
103 remote_engine_config.origin_url = can_report_metrics ? config.origin_url : ""; | 103 remote_engine_config.origin_url = |
| 104 can_report_metrics ? config.origin_url : std::string(); |
104 | 105 |
105 SpeechRecognitionEngine* google_remote_engine; | 106 SpeechRecognitionEngine* google_remote_engine; |
106 if (config.is_legacy_api) { | 107 if (config.is_legacy_api) { |
107 google_remote_engine = | 108 google_remote_engine = |
108 new GoogleOneShotRemoteEngine(config.url_request_context_getter); | 109 new GoogleOneShotRemoteEngine(config.url_request_context_getter); |
109 } else { | 110 } else { |
110 google_remote_engine = | 111 google_remote_engine = |
111 new GoogleStreamingRemoteEngine(config.url_request_context_getter); | 112 new GoogleStreamingRemoteEngine(config.url_request_context_getter); |
112 } | 113 } |
113 | 114 |
(...skipping 527 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 | 642 |
642 SpeechRecognitionManagerImpl::Session::Session() | 643 SpeechRecognitionManagerImpl::Session::Session() |
643 : id(kSessionIDInvalid), | 644 : id(kSessionIDInvalid), |
644 listener_is_active(true) { | 645 listener_is_active(true) { |
645 } | 646 } |
646 | 647 |
647 SpeechRecognitionManagerImpl::Session::~Session() { | 648 SpeechRecognitionManagerImpl::Session::~Session() { |
648 } | 649 } |
649 | 650 |
650 } // namespace content | 651 } // namespace content |
OLD | NEW |