| 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 | 8 |
| 9 #include <memory> | 9 #include <memory> |
| 10 #include <utility> | 10 #include <utility> |
| 11 | 11 |
| 12 #include "base/bind.h" | 12 #include "base/bind.h" |
| 13 #include "base/callback.h" | 13 #include "base/callback.h" |
| 14 #include "base/memory/ptr_util.h" | 14 #include "base/memory/ptr_util.h" |
| 15 #include "base/move.h" | 15 #include "base/move.h" |
| 16 #include "base/stl_util.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 17 #include "base/strings/utf_string_conversions.h" |
| 17 #include "content/child/mojo/type_converters.h" | 18 #include "content/child/mojo/type_converters.h" |
| 18 #include "content/child/scoped_web_callbacks.h" | 19 #include "content/child/scoped_web_callbacks.h" |
| 19 #include "content/public/common/service_registry.h" | 20 #include "content/public/common/service_registry.h" |
| 20 #include "content/renderer/usb/type_converters.h" | 21 #include "content/renderer/usb/type_converters.h" |
| 21 #include "content/renderer/usb/web_usb_device_impl.h" | 22 #include "content/renderer/usb/web_usb_device_impl.h" |
| 22 #include "mojo/public/cpp/bindings/array.h" | 23 #include "mojo/public/cpp/bindings/array.h" |
| 23 #include "mojo/public/cpp/bindings/interface_request.h" | 24 #include "mojo/public/cpp/bindings/interface_request.h" |
| 24 #include "third_party/WebKit/public/platform/WebCallbacks.h" | 25 #include "third_party/WebKit/public/platform/WebCallbacks.h" |
| 25 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceFilter.h
" | 26 #include "third_party/WebKit/public/platform/modules/webusb/WebUSBDeviceFilter.h
" |
| (...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 170 for (size_t i = 0; i < notification->devices_removed.size(); ++i) { | 171 for (size_t i = 0; i < notification->devices_removed.size(); ++i) { |
| 171 const device::usb::DeviceInfoPtr& device_info = | 172 const device::usb::DeviceInfoPtr& device_info = |
| 172 notification->devices_removed[i]; | 173 notification->devices_removed[i]; |
| 173 for (auto observer : observers_) | 174 for (auto observer : observers_) |
| 174 observer->onDeviceDisconnected(base::WrapUnique(new WebUSBDeviceImpl( | 175 observer->onDeviceDisconnected(base::WrapUnique(new WebUSBDeviceImpl( |
| 175 nullptr, mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); | 176 nullptr, mojo::ConvertTo<blink::WebUSBDeviceInfo>(device_info)))); |
| 176 } | 177 } |
| 177 } | 178 } |
| 178 | 179 |
| 179 } // namespace content | 180 } // namespace content |
| OLD | NEW |