New issue
Advanced search Search tips

Issue 665599 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux
Pri: 2
Type: Bug



Sign in to add a comment

Devices in requestDevice dialog can have blank names

Project Member Reported by mwills@google.com, Nov 15 2016

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.100 Safari/537.36

Steps to reproduce the problem:
Plug in PixelC in fastboot mode
Execute navigator.usb.requestDevice({filters:[]})

What is the expected behavior?
Device is listed with some kind of name

What went wrong?
Device is listed with an empty name (no text) in the device chooser dialog.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 54.0.2840.100  Channel: stable
OS Version: 
Flash Version: Shockwave Flash 23.0 r0

It doesn't appear the device actually exposes any strings that Chrome could use, but lsusb at least seems to be able to tell it's a Google Inc. device based on the vendor id. Maybe Chrome could do the same (Google Inc. Device). Or at least display Unknown Device.
 
The chrome.usb API implementation uses the same vendor ID list that lsusb uses in order to find names for devices without string descriptors. I didn't bother hooking that up for WebUSB because the code that filters devices based on WebUSB descriptors also filters out devices without strings. Unfortunately when you pass --disable-webusb-security it also removes the empty string check.
Labels: TE-Hardware-Dependency
Owner: juncai@chromium.org
Status: Assigned (was: Unconfirmed)
Fixing this will be necessary for merging the chooser UI for navigator.usb.requestDevice and chrome.usb.getUserSelectedDevices so I'm assigning this task to juncai@.

As mentioned offline something that chrome.usb.getUserSelectedDevices has to deal with is devices that don't have string descriptors. The logic I suggest implementing is displaying, in decreasing order of preference:

1. UsbDevice::product_string() [Current logic.]
2. UsbIds::GetProductName()
3. "Unknown device from " + UsbIds::GetVendorName()
4. "Unknown device [$VID:$PID]"
Labels: M-57

Comment 5 by juncai@chromium.org, Nov 28 2016

Status: Started (was: Assigned)
Project Member

Comment 6 by bugdroid1@chromium.org, Nov 29 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/06198969e3c76b4999cbdf1a474bb4f94ee275cd

commit 06198969e3c76b4999cbdf1a474bb4f94ee275cd
Author: juncai <juncai@chromium.org>
Date: Tue Nov 29 17:23:27 2016

Fix blank names issue for navigator.usb.requestDevice

Sometimes UsbDevice::product_string() returns empty string, and the
current WebUSB chooser uses it as the device name to be displayed.
This CL fixes the blank name issue by displaying, in decreasing order
of preference:
1. UsbDevice::product_string()
2. UsbIds::GetProductName()
3. "Unknown device from " + UsbIds::GetVendorName()
4. "Unknown device [$VID:$PID]"

BUG= 665599 

Review-Url: https://codereview.chromium.org/2539593002
Cr-Commit-Position: refs/heads/master@{#435019}

[modify] https://crrev.com/06198969e3c76b4999cbdf1a474bb4f94ee275cd/chrome/app/generated_resources.grd
[modify] https://crrev.com/06198969e3c76b4999cbdf1a474bb4f94ee275cd/chrome/browser/usb/usb_chooser_controller.cc

Comment 7 by juncai@chromium.org, Nov 29 2016

Status: Fixed (was: Started)

Sign in to add a comment