OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 <utility> |
| 8 |
7 #include "base/bind.h" | 9 #include "base/bind.h" |
8 #include "base/location.h" | 10 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 11 #include "base/single_thread_task_runner.h" |
10 #include "base/thread_task_runner_handle.h" | 12 #include "base/thread_task_runner_handle.h" |
11 #include "build/build_config.h" | 13 #include "build/build_config.h" |
12 #include "content/browser/browser_main_loop.h" | 14 #include "content/browser/browser_main_loop.h" |
13 #include "content/browser/renderer_host/media/media_stream_manager.h" | 15 #include "content/browser/renderer_host/media/media_stream_manager.h" |
14 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h" | 16 #include "content/browser/renderer_host/media/media_stream_ui_proxy.h" |
15 #include "content/browser/speech/google_one_shot_remote_engine.h" | 17 #include "content/browser/speech/google_one_shot_remote_engine.h" |
16 #include "content/browser/speech/google_streaming_remote_engine.h" | 18 #include "content/browser/speech/google_streaming_remote_engine.h" |
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
233 SessionsTable::iterator iter = sessions_.find(session_id); | 235 SessionsTable::iterator iter = sessions_.find(session_id); |
234 if (iter == sessions_.end()) | 236 if (iter == sessions_.end()) |
235 return; | 237 return; |
236 | 238 |
237 bool is_allowed = !devices.empty(); | 239 bool is_allowed = !devices.empty(); |
238 if (is_allowed) { | 240 if (is_allowed) { |
239 // Copy the approved devices array to the context for UI indication. | 241 // Copy the approved devices array to the context for UI indication. |
240 iter->second->context.devices = devices; | 242 iter->second->context.devices = devices; |
241 | 243 |
242 // Save the UI object. | 244 // Save the UI object. |
243 iter->second->ui = stream_ui.Pass(); | 245 iter->second->ui = std::move(stream_ui); |
244 } | 246 } |
245 | 247 |
246 // Clear the label to indicate the request has been done. | 248 // Clear the label to indicate the request has been done. |
247 iter->second->context.label.clear(); | 249 iter->second->context.label.clear(); |
248 | 250 |
249 // Notify the recognition about the request result. | 251 // Notify the recognition about the request result. |
250 RecognitionAllowedCallback(iter->first, false, is_allowed); | 252 RecognitionAllowedCallback(iter->first, false, is_allowed); |
251 } | 253 } |
252 | 254 |
253 void SpeechRecognitionManagerImpl::AbortSession(int session_id) { | 255 void SpeechRecognitionManagerImpl::AbortSession(int session_id) { |
(...skipping 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
682 SpeechRecognitionManagerImpl::Session::Session() | 684 SpeechRecognitionManagerImpl::Session::Session() |
683 : id(kSessionIDInvalid), | 685 : id(kSessionIDInvalid), |
684 abort_requested(false), | 686 abort_requested(false), |
685 listener_is_active(true) { | 687 listener_is_active(true) { |
686 } | 688 } |
687 | 689 |
688 SpeechRecognitionManagerImpl::Session::~Session() { | 690 SpeechRecognitionManagerImpl::Session::~Session() { |
689 } | 691 } |
690 | 692 |
691 } // namespace content | 693 } // namespace content |
OLD | NEW |