diff options
Diffstat (limited to 'content/renderer/usb')
-rw-r--r-- | content/renderer/usb/type_converters.cc | 1 | ||||
-rw-r--r-- | content/renderer/usb/web_usb_device_impl.cc | 22 | ||||
-rw-r--r-- | content/renderer/usb/web_usb_device_impl.h | 2 |
3 files changed, 1 insertions, 24 deletions
diff --git a/content/renderer/usb/type_converters.cc b/content/renderer/usb/type_converters.cc index acddfaf..5c47c93 100644 --- a/content/renderer/usb/type_converters.cc +++ b/content/renderer/usb/type_converters.cc @@ -213,6 +213,7 @@ TypeConverter<blink::WebUSBDeviceInfo, device::usb::DeviceInfoPtr>::Convert( device.productName = blink::WebString::fromUTF8(info->product_name); if (!info->serial_number.is_null()) device.serialNumber = blink::WebString::fromUTF8(info->serial_number); + device.activeConfiguration = info->active_configuration; device.configurations = blink::WebVector<blink::WebUSBDeviceInfo::Configuration>( info->configurations.size()); diff --git a/content/renderer/usb/web_usb_device_impl.cc b/content/renderer/usb/web_usb_device_impl.cc index d0cedd5..fc6920d 100644 --- a/content/renderer/usb/web_usb_device_impl.cc +++ b/content/renderer/usb/web_usb_device_impl.cc @@ -26,7 +26,6 @@ const char kClaimInterfaceFailed[] = "Unable to claim interface."; const char kClearHaltFailed[] = "Unable to clear endpoint."; const char kDeviceAlreadyOpen[] = "Device has already been opened."; const char kDeviceNoAccess[] = "Access denied."; -const char kDeviceNotConfigured[] = "Device not configured."; const char kDeviceUnavailable[] = "Device unavailable."; const char kDeviceResetFailed[] = "Unable to reset the device."; const char kReleaseInterfaceFailed[] = "Unable to release interface."; @@ -90,19 +89,6 @@ void OnDeviceClosed( callbacks.PassCallbacks()->onSuccess(); } -void OnGetConfiguration( - ScopedWebCallbacks<blink::WebUSBDeviceGetConfigurationCallbacks> callbacks, - uint8_t configuration_value) { - auto scoped_callbacks = callbacks.PassCallbacks(); - if (configuration_value == 0) { - RejectWithError(blink::WebUSBError(blink::WebUSBError::Error::NotFound, - kDeviceNotConfigured), - std::move(scoped_callbacks)); - } else { - scoped_callbacks->onSuccess(configuration_value); - } -} - void HandlePassFailDeviceOperation( ScopedWebCallbacks<blink::WebCallbacks<void, const blink::WebUSBError&>> callbacks, @@ -258,14 +244,6 @@ void WebUSBDeviceImpl::close(blink::WebUSBDeviceCloseCallbacks* callbacks) { base::Bind(&OnDeviceClosed, base::Passed(&scoped_callbacks))); } -void WebUSBDeviceImpl::getConfiguration( - blink::WebUSBDeviceGetConfigurationCallbacks* callbacks) { - auto scoped_callbacks = MakeScopedUSBCallbacks(callbacks); - if (device_) - device_->GetConfiguration( - base::Bind(&OnGetConfiguration, base::Passed(&scoped_callbacks))); -} - void WebUSBDeviceImpl::setConfiguration( uint8_t configuration_value, blink::WebUSBDeviceSetConfigurationCallbacks* callbacks) { diff --git a/content/renderer/usb/web_usb_device_impl.h b/content/renderer/usb/web_usb_device_impl.h index d2bd81d..dea2e8f 100644 --- a/content/renderer/usb/web_usb_device_impl.h +++ b/content/renderer/usb/web_usb_device_impl.h @@ -35,8 +35,6 @@ class WebUSBDeviceImpl : public blink::WebUSBDevice { const blink::WebUSBDeviceInfo& info() const override; void open(blink::WebUSBDeviceOpenCallbacks* callbacks) override; void close(blink::WebUSBDeviceCloseCallbacks* callbacks) override; - void getConfiguration( - blink::WebUSBDeviceGetConfigurationCallbacks* callbacks) override; void setConfiguration( uint8_t configuration_value, blink::WebUSBDeviceSetConfigurationCallbacks* callbacks) override; |