| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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/usb/web_usb_client_impl.h" | 5 #include "content/renderer/usb/web_usb_client_impl.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> | 8 #include <utility> |
| 9 | 9 |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 notification->devices_added[i]; | 154 notification->devices_added[i]; |
| 155 device::usb::DevicePtr device; | 155 device::usb::DevicePtr device; |
| 156 device_manager_->GetDevice(device_info->guid, mojo::GetProxy(&device)); | 156 device_manager_->GetDevice(device_info->guid, mojo::GetProxy(&device)); |
| 157 observer_->onDeviceConnected(blink::adoptWebPtr(new WebUSBDeviceImpl( | 157 observer_->onDeviceConnected(blink::adoptWebPtr(new WebUSBDeviceImpl( |
| 158 std::move(device), | 158 std::move(device), |
| 159 mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); | 159 mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); |
| 160 } | 160 } |
| 161 for (size_t i = 0; i < notification->devices_removed.size(); ++i) { | 161 for (size_t i = 0; i < notification->devices_removed.size(); ++i) { |
| 162 const device::usb::DeviceInfoPtr& device_info = | 162 const device::usb::DeviceInfoPtr& device_info = |
| 163 notification->devices_removed[i]; | 163 notification->devices_removed[i]; |
| 164 device::usb::DevicePtr device; | |
| 165 device_manager_->GetDevice(device_info->guid, mojo::GetProxy(&device)); | |
| 166 observer_->onDeviceDisconnected(blink::adoptWebPtr(new WebUSBDeviceImpl( | 164 observer_->onDeviceDisconnected(blink::adoptWebPtr(new WebUSBDeviceImpl( |
| 167 std::move(device), | 165 nullptr, mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); |
| 168 mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); | |
| 169 } | 166 } |
| 170 } | 167 } |
| 171 | 168 |
| 172 } // namespace content | 169 } // namespace content |
| OLD | NEW |