| 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 { | 10 namespace content { | 
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 71 } | 71 } | 
| 72 | 72 | 
| 73 void PepperDeviceEnumerationEventHandler::OnDeviceOpened( | 73 void PepperDeviceEnumerationEventHandler::OnDeviceOpened( | 
| 74     int request_id, | 74     int request_id, | 
| 75     const std::string& label, | 75     const std::string& label, | 
| 76     const StreamDeviceInfo& device_info) { | 76     const StreamDeviceInfo& device_info) { | 
| 77   NotifyDeviceOpened(request_id, true, label); | 77   NotifyDeviceOpened(request_id, true, label); | 
| 78 } | 78 } | 
| 79 | 79 | 
| 80 void PepperDeviceEnumerationEventHandler::OnDeviceOpenFailed(int request_id) { | 80 void PepperDeviceEnumerationEventHandler::OnDeviceOpenFailed(int request_id) { | 
| 81   NotifyDeviceOpened(request_id, false, ""); | 81   NotifyDeviceOpened(request_id, false, std::string()); | 
| 82 } | 82 } | 
| 83 | 83 | 
| 84 // static | 84 // static | 
| 85 MediaStreamType PepperDeviceEnumerationEventHandler::FromPepperDeviceType( | 85 MediaStreamType PepperDeviceEnumerationEventHandler::FromPepperDeviceType( | 
| 86     PP_DeviceType_Dev type) { | 86     PP_DeviceType_Dev type) { | 
| 87   switch (type) { | 87   switch (type) { | 
| 88     case PP_DEVICETYPE_DEV_INVALID: | 88     case PP_DEVICETYPE_DEV_INVALID: | 
| 89       return MEDIA_NO_SERVICE; | 89       return MEDIA_NO_SERVICE; | 
| 90     case PP_DEVICETYPE_DEV_AUDIOCAPTURE: | 90     case PP_DEVICETYPE_DEV_AUDIOCAPTURE: | 
| 91       return MEDIA_DEVICE_AUDIO_CAPTURE; | 91       return MEDIA_DEVICE_AUDIO_CAPTURE; | 
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 148     return; | 148     return; | 
| 149   } | 149   } | 
| 150 | 150 | 
| 151   PepperPluginDelegateImpl::OpenDeviceCallback callback = iter->second; | 151   PepperPluginDelegateImpl::OpenDeviceCallback callback = iter->second; | 
| 152   open_callbacks_.erase(iter); | 152   open_callbacks_.erase(iter); | 
| 153 | 153 | 
| 154   callback.Run(request_id, succeeded, label); | 154   callback.Run(request_id, succeeded, label); | 
| 155 } | 155 } | 
| 156 | 156 | 
| 157 }  // namespace content | 157 }  // namespace content | 
| OLD | NEW | 
|---|