Lines Matching refs:caller_id
101 int caller_id,
108 virtual void CancelRecognition(int caller_id);
109 virtual void StopRecording(int caller_id);
114 virtual void DidStartReceivingAudio(int caller_id);
115 virtual void SetRecognitionResult(int caller_id,
118 virtual void DidCompleteRecording(int caller_id);
119 virtual void DidCompleteRecognition(int caller_id);
120 virtual void OnRecognizerError(int caller_id,
122 virtual void DidCompleteEnvironmentEstimation(int caller_id);
123 virtual void SetInputVolume(int caller_id, float volume, float noise_volume);
126 virtual void InfoBubbleButtonClicked(int caller_id,
128 virtual void InfoBubbleFocusChanged(int caller_id);
142 bool HasPendingRequest(int caller_id) const;
143 SpeechInputManagerDelegate* GetDelegate(int caller_id) const;
145 void CancelRecognitionAndInformDelegate(int caller_id);
148 void StartRecognitionForRequest(int caller_id);
192 bool SpeechInputManagerImpl::HasPendingRequest(int caller_id) const {
193 return requests_.find(caller_id) != requests_.end();
197 int caller_id) const {
198 return requests_.find(caller_id)->second.delegate;
203 int caller_id,
210 DCHECK(!HasPendingRequest(caller_id));
212 bubble_controller_->CreateBubble(caller_id, render_process_id, render_view_id,
227 SpeechInputRequest* request = &requests_[caller_id];
230 this, caller_id, language, grammar, optional_request_info_->value(),
234 StartRecognitionForRequest(caller_id);
237 void SpeechInputManagerImpl::StartRecognitionForRequest(int caller_id) {
238 DCHECK(HasPendingRequest(caller_id));
246 caller_id, l10n_util::GetStringUTF16(IDS_SPEECH_INPUT_NO_MIC));
248 recording_caller_id_ = caller_id;
249 requests_[caller_id].is_active = true;
250 requests_[caller_id].recognizer->StartRecording();
251 bubble_controller_->SetBubbleWarmUpMode(caller_id);
255 void SpeechInputManagerImpl::CancelRecognition(int caller_id) {
256 DCHECK(HasPendingRequest(caller_id));
257 if (requests_[caller_id].is_active)
258 requests_[caller_id].recognizer->CancelRecognition();
259 requests_.erase(caller_id);
260 if (recording_caller_id_ == caller_id)
262 bubble_controller_->CloseBubble(caller_id);
279 void SpeechInputManagerImpl::StopRecording(int caller_id) {
280 DCHECK(HasPendingRequest(caller_id));
281 requests_[caller_id].recognizer->StopRecording();
285 int caller_id, bool error, const SpeechInputResultArray& result) {
286 DCHECK(HasPendingRequest(caller_id));
287 GetDelegate(caller_id)->SetRecognitionResult(caller_id, result);
290 void SpeechInputManagerImpl::DidCompleteRecording(int caller_id) {
291 DCHECK(recording_caller_id_ == caller_id);
292 DCHECK(HasPendingRequest(caller_id));
294 GetDelegate(caller_id)->DidCompleteRecording(caller_id);
295 bubble_controller_->SetBubbleRecognizingMode(caller_id);
298 void SpeechInputManagerImpl::DidCompleteRecognition(int caller_id) {
299 GetDelegate(caller_id)->DidCompleteRecognition(caller_id);
300 requests_.erase(caller_id);
301 bubble_controller_->CloseBubble(caller_id);
305 int caller_id, SpeechRecognizer::ErrorCode error) {
306 if (caller_id == recording_caller_id_)
309 requests_[caller_id].is_active = false;
329 caller_id,
338 void SpeechInputManagerImpl::DidStartReceivingAudio(int caller_id) {
339 DCHECK(HasPendingRequest(caller_id));
340 DCHECK(recording_caller_id_ == caller_id);
341 bubble_controller_->SetBubbleRecordingMode(caller_id);
344 void SpeechInputManagerImpl::DidCompleteEnvironmentEstimation(int caller_id) {
345 DCHECK(HasPendingRequest(caller_id));
346 DCHECK(recording_caller_id_ == caller_id);
349 void SpeechInputManagerImpl::SetInputVolume(int caller_id, float volume,
351 DCHECK(HasPendingRequest(caller_id));
352 DCHECK_EQ(recording_caller_id_, caller_id);
354 bubble_controller_->SetBubbleInputVolume(caller_id, volume, noise_volume);
357 void SpeechInputManagerImpl::CancelRecognitionAndInformDelegate(int caller_id) {
358 SpeechInputManagerDelegate* cur_delegate = GetDelegate(caller_id);
359 CancelRecognition(caller_id);
360 cur_delegate->DidCompleteRecording(caller_id);
361 cur_delegate->DidCompleteRecognition(caller_id);
365 int caller_id, SpeechInputBubble::Button button) {
370 if (!HasPendingRequest(caller_id))
374 CancelRecognitionAndInformDelegate(caller_id);
376 StartRecognitionForRequest(caller_id);
380 void SpeechInputManagerImpl::InfoBubbleFocusChanged(int caller_id) {
385 if (HasPendingRequest(caller_id)) {
390 if (recording_caller_id_ == caller_id || !requests_[caller_id].is_active) {
391 CancelRecognitionAndInformDelegate(caller_id);