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> | 7 #include <utility> |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/location.h" | 10 #include "base/location.h" |
(...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
222 base::ThreadTaskRunnerHandle::Get()->PostTask( | 222 base::ThreadTaskRunnerHandle::Get()->PostTask( |
223 FROM_HERE, | 223 FROM_HERE, |
224 base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, | 224 base::Bind(&SpeechRecognitionManagerImpl::DispatchEvent, |
225 weak_factory_.GetWeakPtr(), session_id, EVENT_ABORT)); | 225 weak_factory_.GetWeakPtr(), session_id, EVENT_ABORT)); |
226 } | 226 } |
227 } | 227 } |
228 | 228 |
229 void SpeechRecognitionManagerImpl::MediaRequestPermissionCallback( | 229 void SpeechRecognitionManagerImpl::MediaRequestPermissionCallback( |
230 int session_id, | 230 int session_id, |
231 const MediaStreamDevices& devices, | 231 const MediaStreamDevices& devices, |
232 scoped_ptr<MediaStreamUIProxy> stream_ui) { | 232 std::unique_ptr<MediaStreamUIProxy> stream_ui) { |
233 DCHECK_CURRENTLY_ON(BrowserThread::IO); | 233 DCHECK_CURRENTLY_ON(BrowserThread::IO); |
234 | 234 |
235 SessionsTable::iterator iter = sessions_.find(session_id); | 235 SessionsTable::iterator iter = sessions_.find(session_id); |
236 if (iter == sessions_.end()) | 236 if (iter == sessions_.end()) |
237 return; | 237 return; |
238 | 238 |
239 bool is_allowed = !devices.empty(); | 239 bool is_allowed = !devices.empty(); |
240 if (is_allowed) { | 240 if (is_allowed) { |
241 // Copy the approved devices array to the context for UI indication. | 241 // Copy the approved devices array to the context for UI indication. |
242 iter->second->context.devices = devices; | 242 iter->second->context.devices = devices; |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 SpeechRecognitionManagerImpl::Session::Session() | 684 SpeechRecognitionManagerImpl::Session::Session() |
685 : id(kSessionIDInvalid), | 685 : id(kSessionIDInvalid), |
686 abort_requested(false), | 686 abort_requested(false), |
687 listener_is_active(true) { | 687 listener_is_active(true) { |
688 } | 688 } |
689 | 689 |
690 SpeechRecognitionManagerImpl::Session::~Session() { | 690 SpeechRecognitionManagerImpl::Session::~Session() { |
691 } | 691 } |
692 | 692 |
693 } // namespace content | 693 } // namespace content |
OLD | NEW |