| 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/renderer/pepper/pepper_device_enumeration_event_handler.h" | 5 #include "content/renderer/pepper/pepper_device_enumeration_event_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "ppapi/shared_impl/ppb_device_ref_shared.h" | 8 #include "ppapi/shared_impl/ppb_device_ref_shared.h" |
| 9 | 9 |
| 10 namespace content { |
| 11 |
| 10 namespace { | 12 namespace { |
| 11 | 13 |
| 12 ppapi::DeviceRefData FromStreamDeviceInfo( | 14 ppapi::DeviceRefData FromStreamDeviceInfo( |
| 13 const media_stream::StreamDeviceInfo& info) { | 15 const media_stream::StreamDeviceInfo& info) { |
| 14 ppapi::DeviceRefData data; | 16 ppapi::DeviceRefData data; |
| 15 data.id = info.device_id; | 17 data.id = info.device_id; |
| 16 data.name = info.name; | 18 data.name = info.name; |
| 17 data.type = PepperDeviceEnumerationEventHandler::FromMediaStreamType( | 19 data.type = PepperDeviceEnumerationEventHandler::FromMediaStreamType( |
| 18 info.stream_type); | 20 info.stream_type); |
| 19 return data; | 21 return data; |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 if (iter == open_callbacks_.end()) { | 154 if (iter == open_callbacks_.end()) { |
| 153 NOTREACHED(); | 155 NOTREACHED(); |
| 154 return; | 156 return; |
| 155 } | 157 } |
| 156 | 158 |
| 157 PepperPluginDelegateImpl::OpenDeviceCallback callback = iter->second; | 159 PepperPluginDelegateImpl::OpenDeviceCallback callback = iter->second; |
| 158 open_callbacks_.erase(iter); | 160 open_callbacks_.erase(iter); |
| 159 | 161 |
| 160 callback.Run(request_id, succeeded, label); | 162 callback.Run(request_id, succeeded, label); |
| 161 } | 163 } |
| 164 |
| 165 } // namespace content |
| OLD | NEW |