New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 601627 link

Starred by 6 users

Issue metadata

Status: Fixed
Owner:
Closed: Aug 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Android
Pri: 3
Type: Feature

Blocked on:
issue 591735

Blocking:
issue 576958



Sign in to add a comment

WebUSB on Android

Project Member Reported by reillyg@chromium.org, Apr 7 2016

Issue description

Tracking bug for WebUSB support on Android.
 
Blockedon: 591735
Project Member

Comment 2 by bugdroid1@chromium.org, Apr 14 2016

Project Member

Comment 3 by bugdroid1@chromium.org, Apr 15 2016

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

commit 4ee09b3e7eab98835bc1a47c55f3b3080c2f5fd3
Author: wfh <wfh@chromium.org>
Date: Fri Apr 15 21:37:29 2016

Revert of Replace libusb in the Linux/Chrome OS USB I/O path. (patchset #3 id:60001 of https://codereview.chromium.org/1877503003/ )

Reason for revert:
broke u2f see  crbug.com/603962 

Original issue's description:
> Replace libusb in the Linux/Chrome OS USB I/O path.
>
> As a first step in adding support for connecting to USB devices on
> Android this patch replaces the libusb-based implementation of
> UsbDeviceHandle used on Linux and Chrome OS with one written directly to
> the Linux usbdevfs ioctl interface.
>
> BUG=422562, 601627 
>
> Committed: https://crrev.com/fed1de7faf5d91a3282d461fd1c0657f8fe3a533
> Cr-Commit-Position: refs/heads/master@{#387315}

TBR=juncai@chromium.org,reillyg@chromium.org
# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=422562, 601627 , 603962 

Review URL: https://codereview.chromium.org/1897483003

Cr-Commit-Position: refs/heads/master@{#387704}

[modify] https://crrev.com/4ee09b3e7eab98835bc1a47c55f3b3080c2f5fd3/device/usb/BUILD.gn
[modify] https://crrev.com/4ee09b3e7eab98835bc1a47c55f3b3080c2f5fd3/device/usb/usb.gyp
[modify] https://crrev.com/4ee09b3e7eab98835bc1a47c55f3b3080c2f5fd3/device/usb/usb_device_handle.h
[modify] https://crrev.com/4ee09b3e7eab98835bc1a47c55f3b3080c2f5fd3/device/usb/usb_device_handle_unittest.cc
[delete] https://crrev.com/1b17dc30c89fc6a7a70a490ac942e853537fc2b9/device/usb/usb_device_handle_usbfs.cc
[delete] https://crrev.com/1b17dc30c89fc6a7a70a490ac942e853537fc2b9/device/usb/usb_device_handle_usbfs.h
[modify] https://crrev.com/4ee09b3e7eab98835bc1a47c55f3b3080c2f5fd3/device/usb/usb_device_impl.cc
[modify] https://crrev.com/4ee09b3e7eab98835bc1a47c55f3b3080c2f5fd3/device/usb/usb_device_impl.h

Project Member

Comment 4 by bugdroid1@chromium.org, Apr 20 2016

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

commit 2f3b6285b45d43141dfc72131dd81702e4342f85
Author: reillyg <reillyg@chromium.org>
Date: Wed Apr 20 01:47:27 2016

Reland of Replace libusb in the Linux/Chrome OS USB I/O path. (patchset #1 id:1 of https://codereview.chromium.org/1897483003/ )

Reason for revert:
Fixed Windows/OS X issue.

Original issue's description:
> Revert of Replace libusb in the Linux/Chrome OS USB I/O path. (patchset #3 id:60001 of https://codereview.chromium.org/1877503003/ )
>
> Reason for revert:
> broke u2f see  crbug.com/603962 
>
> Original issue's description:
> > Replace libusb in the Linux/Chrome OS USB I/O path.
> >
> > As a first step in adding support for connecting to USB devices on
> > Android this patch replaces the libusb-based implementation of
> > UsbDeviceHandle used on Linux and Chrome OS with one written directly to
> > the Linux usbdevfs ioctl interface.
> >
> > BUG=422562, 601627 
> >
> > Committed: https://crrev.com/fed1de7faf5d91a3282d461fd1c0657f8fe3a533
> > Cr-Commit-Position: refs/heads/master@{#387315}
>
> TBR=juncai@chromium.org,reillyg@chromium.org
> # Not skipping CQ checks because original CL landed more than 1 days ago.
> BUG=422562, 601627 , 603962 
>
> Committed: https://crrev.com/4ee09b3e7eab98835bc1a47c55f3b3080c2f5fd3
> Cr-Commit-Position: refs/heads/master@{#387704}

# Not skipping CQ checks because original CL landed more than 1 days ago.
BUG=422562, 601627 , 603962 

Review URL: https://codereview.chromium.org/1902313002

Cr-Commit-Position: refs/heads/master@{#388402}

[modify] https://crrev.com/2f3b6285b45d43141dfc72131dd81702e4342f85/device/usb/BUILD.gn
[modify] https://crrev.com/2f3b6285b45d43141dfc72131dd81702e4342f85/device/usb/usb.gyp
[modify] https://crrev.com/2f3b6285b45d43141dfc72131dd81702e4342f85/device/usb/usb_device_handle.h
[modify] https://crrev.com/2f3b6285b45d43141dfc72131dd81702e4342f85/device/usb/usb_device_handle_unittest.cc
[add] https://crrev.com/2f3b6285b45d43141dfc72131dd81702e4342f85/device/usb/usb_device_handle_usbfs.cc
[add] https://crrev.com/2f3b6285b45d43141dfc72131dd81702e4342f85/device/usb/usb_device_handle_usbfs.h
[modify] https://crrev.com/2f3b6285b45d43141dfc72131dd81702e4342f85/device/usb/usb_device_impl.cc
[modify] https://crrev.com/2f3b6285b45d43141dfc72131dd81702e4342f85/device/usb/usb_device_impl.h

Blocking: 576958
Status: Started (was: Assigned)
Implementing permission revocation is blocking a WebUSB experimental launch on Android.
Cc: rolfe@chromium.org
rolfe@, I need drawable-*dpi assets for the USB settings.

Comment 8 by rolfe@chromium.org, Jul 8 2016

A USB icon specifically in svg? I believe sgabriel@ cut that already and estade@ has access. Or you need different icons? (close button?) Let me know!
Sorry, should have been more specific. I am talking about the USB logo icon that will appear before the USB category and each individual USB device. I need them in PNG at the full set of device resolutions.

Comment 10 by rolfe@chromium.org, Jul 11 2016

I think the assets you need are posted here:
https://bugs.chromium.org/p/chromium/issues/detail?id=424667#c29

Sometimes the older links don't work as we restructured our Drive around the time that was posted. But try those and let me know if you have any trouble.
Screenshot of the UI from https://codereview.chromium.org/2134463002/. rolfe@ and I discussed this offline and decided to simplify the mocks, arriving at this design.
Screenshot_20160712-174039.png
58.8 KB View Download

Comment 13 by rolfe@chromium.org, Jul 13 2016

Looks great!
Project Member

Comment 14 by bugdroid1@chromium.org, Jul 15 2016

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

commit 7280deea31d7794becbc7f86fb0870a129c54439
Author: reillyg <reillyg@chromium.org>
Date: Fri Jul 15 22:51:33 2016

Add USB device permissions to individual site settings on Android.

This patch makes it possible to view and revoke permission to access a
USB device by going to an origin's "site settings" page.

BUG= 430999 , 601627 

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

[add] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/res/drawable-hdpi/settings_usb.png
[add] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/res/drawable-mdpi/settings_usb.png
[add] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/res/drawable-xhdpi/settings_usb.png
[add] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/res/drawable-xxhdpi/settings_usb.png
[add] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/res/drawable-xxxhdpi/settings_usb.png
[add] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/res/layout/usb_permission.xml
[modify] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java
[add] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbInfo.java
[modify] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java
[modify] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java
[modify] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java
[modify] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java/strings/android_chrome_strings.grd
[modify] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/android/java_sources.gni
[modify] https://crrev.com/7280deea31d7794becbc7f86fb0870a129c54439/chrome/browser/android/preferences/website_preference_bridge.cc

Project Member

Comment 15 by bugdroid1@chromium.org, Jul 20 2016

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

commit d746e82173895858a05b3b21912f20c24f22eb9c
Author: reillyg <reillyg@chromium.org>
Date: Tue Jul 19 23:58:33 2016

Revert r404778 and r405887.

These patches attempted to simplify how website permissions were handled
on Android and add new code to display USB device permissions.

Unfortunately the first has caused a regression for other permission
types so I will revert both until we have a better solution.

BUG= 430999 , 601627 ,628986
TBR=twellington@chromium.org,bauerb@chromium.org

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

[delete] https://crrev.com/6b901f8f0d34988b0df126d33cf68cc103d1d9d9/chrome/android/java/res/drawable-hdpi/settings_usb.png
[delete] https://crrev.com/6b901f8f0d34988b0df126d33cf68cc103d1d9d9/chrome/android/java/res/drawable-mdpi/settings_usb.png
[delete] https://crrev.com/6b901f8f0d34988b0df126d33cf68cc103d1d9d9/chrome/android/java/res/drawable-xhdpi/settings_usb.png
[delete] https://crrev.com/6b901f8f0d34988b0df126d33cf68cc103d1d9d9/chrome/android/java/res/drawable-xxhdpi/settings_usb.png
[delete] https://crrev.com/6b901f8f0d34988b0df126d33cf68cc103d1d9d9/chrome/android/java/res/drawable-xxxhdpi/settings_usb.png
[delete] https://crrev.com/6b901f8f0d34988b0df126d33cf68cc103d1d9d9/chrome/android/java/res/layout/usb_permission.xml
[modify] https://crrev.com/d746e82173895858a05b3b21912f20c24f22eb9c/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java
[delete] https://crrev.com/6b901f8f0d34988b0df126d33cf68cc103d1d9d9/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbInfo.java
[modify] https://crrev.com/d746e82173895858a05b3b21912f20c24f22eb9c/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java
[modify] https://crrev.com/d746e82173895858a05b3b21912f20c24f22eb9c/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java
[modify] https://crrev.com/d746e82173895858a05b3b21912f20c24f22eb9c/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java
[modify] https://crrev.com/d746e82173895858a05b3b21912f20c24f22eb9c/chrome/android/java/strings/android_chrome_strings.grd
[modify] https://crrev.com/d746e82173895858a05b3b21912f20c24f22eb9c/chrome/android/java_sources.gni
[modify] https://crrev.com/d746e82173895858a05b3b21912f20c24f22eb9c/chrome/browser/android/preferences/website_preference_bridge.cc

Project Member

Comment 16 by bugdroid1@chromium.org, Jul 21 2016

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

commit fc4b6a7702df12a0f1f55122e13231f1c4c7ebff
Author: reillyg <reillyg@chromium.org>
Date: Thu Jul 21 22:18:37 2016

Reuse Website objects in WebsitePermissionFetcher.

This patch is a rewrite of r404778. Instead of creating a new Website
instance of each permission they are now reused to collect all
permissions associated with an origin/embedder pair.

The callback from WebsitePermissionFetcher is now also substantially
simpler because it turns out that no callers actually cared about
receiving the maps it was generating. All they wanted was a collection
of Websites.

BUG= 430999 , 601627 

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

[modify] https://crrev.com/fc4b6a7702df12a0f1f55122e13231f1c4c7ebff/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ManageSpaceActivity.java
[modify] https://crrev.com/fc4b6a7702df12a0f1f55122e13231f1c4c7ebff/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleCategoryPreferences.java
[modify] https://crrev.com/fc4b6a7702df12a0f1f55122e13231f1c4c7ebff/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java
[modify] https://crrev.com/fc4b6a7702df12a0f1f55122e13231f1c4c7ebff/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java
[modify] https://crrev.com/fc4b6a7702df12a0f1f55122e13231f1c4c7ebff/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java
[modify] https://crrev.com/fc4b6a7702df12a0f1f55122e13231f1c4c7ebff/chrome/android/javatests/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferencesTest.java

Project Member

Comment 17 by bugdroid1@chromium.org, Jul 22 2016

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

commit dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef
Author: reillyg <reillyg@chromium.org>
Date: Fri Jul 22 19:09:23 2016

Reland: Add USB device permissions to individual site settings on Android.

This patch makes it possible to view and revoke permission to access a
USB device by going to an origin's "site settings" page.

This is a reland of r405887.

BUG= 430999 , 601627 

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

[add] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/res/drawable-hdpi/settings_usb.png
[add] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/res/drawable-mdpi/settings_usb.png
[add] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/res/drawable-xhdpi/settings_usb.png
[add] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/res/drawable-xxhdpi/settings_usb.png
[add] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/res/drawable-xxxhdpi/settings_usb.png
[add] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/res/layout/usb_permission.xml
[modify] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SingleWebsitePreferences.java
[add] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbInfo.java
[modify] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/Website.java
[modify] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java
[modify] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePreferenceBridge.java
[modify] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java/strings/android_chrome_strings.grd
[modify] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/android/java_sources.gni
[modify] https://crrev.com/dab75c76cbefbf6355f6c8e6e013b741bf6ad4ef/chrome/browser/android/preferences/website_preference_bridge.cc

Screenshot of the UI added in https://codereview.chromium.org/2185213002. For now I am reusing the text "- Allowed" that is displayed for other types of permissions. The mocks show "- Connected" but that will require more infrastructure to communicate the device connection state into this UI.
Screenshot (Jul 27, 2016 3-40-09 PM).png
58.6 KB View Download

Comment 19 by rolfe@chromium.org, Jul 28 2016

Thanks for the screenshot! Looks good.
Cc: dominickn@chromium.org benwells@chromium.org
Can you post a screenshot of what it looks like with multiple USB devices and some other permissions (e.g. geolocation)?
screen.png
117 KB View Download
Thanks. There is only one USB device there, what does it look like with two or three?
The same, just with 2 or 3. After I get these patches landed I'm going to look into what to do when there are two devices with the same name as as you can see from the screenshot displaying the same text multiple times isn't very helpful. In site settings there's room for some text below the device name such as the serial number. Not sure about in this drop-down. Maybe since these screen doesn't have edit controls we should just deduplicate by name and provide the more detailed view when you tap "site settings".
Screenshot (Aug 1, 2016 11-29-22 AM).png
111 KB View Download
I sent this screengrab to maxwalker@, a designer thinking about page info. If we can get the editable options back into page info, distinguishing the titles here will become more important. I think Bluetooth had the same trouble and was going to append the title with some ID number (not sure if all users could distinguish them this way but perhaps this would work here as well.)
I think this is fine for experimenting but I'm not sure that we should release this. My main concern is how scalable this is. Does it just show currently connected USB devices, or all the USb devices the page has been granted access to?

Some other concerns:
- seems inconsistent with how we do other permissions, e.g. all cameras are lumped under one thing currently
- the multiple-device-same-name problem

rolfe@, what do you think about displaying "$DEVICE_NAME" for a single device and "$DEVICE_NAME and $N other devices" for more than one device? Tapping "SITE SETTINGS" will then display the full list. I don't want to just say "USB - Allowed" because unlike the camera the permission doesn't apply to all USB devices.
Cc: maxwalker@chromium.org
+maxwalker who has started to revisit the page info dialog in case of a second opinion!

What's the likelihood of a user having >1 USB devices attached? Seems low, very power-user. Regardless, it would be hard security-wise to know which one to show. First attached? Most recently attached? Is a camera or mic more sensitive? That's why they are listed individually (like bluetooth devices) as we don't know what they are, which makes them different from cameras (I think I've got that right!) My vote for now would be to keep them listed separately. But it would only be for connected devices, not all the ones that have been granted permission. Would that resolve the concern, benwells@? Probably not 100% but hoping a step in the right direction, and maybe maxwalker@ has alternative ideas to explore for a future page info.
It depends on whether all devices the site has access to are shown, or just the ones currently attached. I think it will be unlikely for users to have multiple devices concurrently attached, but quite common for users to grant multiple devices over a period of time.

I can imagine use cases for this where users could easily grant access to tens of devices, e.g. some smart but small / cheap device which people buy many of and configure over usb.
Project Member

Comment 29 by bugdroid1@chromium.org, Aug 3 2016

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

commit 58f82ab510dc67bbf55c60f99abe8e1339534c19
Author: reillyg <reillyg@chromium.org>
Date: Wed Aug 03 01:49:52 2016

Display USB devices in the site settings popup on Android.

This patch adds USB devices (and any other type of chosen object that is
defined in the future such as Bluetooth devices) to the list of
permissions displayed in the site settings popup on Android that is
displayed when the site icon is tapped.

BUG= 601627 

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

[modify] https://crrev.com/58f82ab510dc67bbf55c60f99abe8e1339534c19/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/ContentSettingsResources.java
[modify] https://crrev.com/58f82ab510dc67bbf55c60f99abe8e1339534c19/chrome/browser/ui/android/website_settings_popup_android.cc
[modify] https://crrev.com/58f82ab510dc67bbf55c60f99abe8e1339534c19/chrome/browser/ui/website_settings/website_settings.cc
[modify] https://crrev.com/58f82ab510dc67bbf55c60f99abe8e1339534c19/chrome/browser/ui/website_settings/website_settings.h

OK awesome. In my mind for USB it would be connected devices only showing up in page info. Probably more an issue for Bluetooth where you could have multiple devices connected (not USB port limit.) But at the moment I'm comfortable showing all of them and seeing if there's a better grouping solution in a future evolution of page info. I like your concept of mapping them somewhat to cameras/mics (wish we could do it more officially if we only knew what the USB and Bluetooth devices were.)
Screenshots of the new preference screens in https://codereview.chromium.org/2159533002. Tapping a device in the list (sorry, both of these devices have the same name and I haven't added plumbing for serial numbers next) will bring you to the screen displaying all the sites with permission to access that device.
Screenshot_20160803-133344.png
69.7 KB View Download
Screenshot_20160803-133351.png
44.0 KB View Download
Understood on naming. Looks good so far!
Reilly, can you confirm that only the currently connected devices would show up in the page info dialog?
Currently all devices show up in the page info dialog.
In the current implementation if the user arrives back at the "device detail" screen (the first screenshot above) and there are no longer any sites left with permission to access the device then they are automatically sent back to the "usb settings" screen (the second screenshot above). The reasoning here is that continuing to show the device and simply displaying the device name and a useless 'x' button isn't very intuitive if the user has just cleared a site's permission to access it. The result is clearer if they are sent all the way back to the list of devices which may, if there are no more, simply say "you do not have any website settings" (see new screenshot).

The question that came up in the review is that it may take a fraction of a second for the activity to refresh the list of sites and decide to dismiss itself and this itself could be confusing. An opinion from UX would be appreciated. If my explanation is unclear I can do a demo.
Screenshot (Aug 4, 2016 5-51-26 PM).png
38.5 KB View Download
Good point. Can you use a spinner in the center of the screen until everything is resolved? Might have to prolong it a bit beyond a fraction of a second. But I like that the spinner is an element we already have in the build and it saves you having to add a new string/subsequent translations. Probably the transition will be trickiest to get right. Might have to meet to work out that bit.
I should have added, the settings loading taking any time at all is mostly a theory. In practice I've never seen it take a noticeable amount of time and none of the other preference screens have an affordance for loading time.

The question was really about the automatic dismissal of the intermediate activity when permissions are cleared.
Sync settings used to have a spinner affordance for loading, or least it was pitched but maybe we didn't go in that direction. The affordance I don't know that we have existing actually is automatic dismissal, although I'm sure there's something if we just think about it more...

You could do something like "Clear & reset" for a single site's settings. Animate out the screen back to the most useful USB settings page. If there's no USB devices I'd go all the way to the main site settings list. Possibly want an undo toast (like when clearing a bookmark) if this feels too easily done but for now it's not needed.

Do we still need to think of an empty state for USB devices? We could use "No USB devices here" It's similar to a recently approved string in UI Review for a different project:
https://groups.google.com/a/google.com/forum/#!topic/chrome-ui-review/ERFhr3W3Ogc
Screenshot #1, a device after all permissions have been revoked. This is the same empty list (with no text) we see for things like location permission.

Screenshot #2, the USB preference screen when no device permissions are stored. I've updated the string to be more specific than the generic message we use other places like the storage preference screen.
Screenshot_20160811-110111.png
45.1 KB View Download
Screenshot_20160811-110204.png
33.4 KB View Download

Comment 40 by rolfe@chromium.org, Aug 11 2016

Strings are always tricky. You could go a couple different directions, and even then everyone has an opinion!

Do I have it right that if you were to hit the "x" button you'd get the empty screen with the string? I think because in the non-empty state it lists devices rather than sites with access, you could still go with "No USB devices here"

Or you could go with a completely different empty state. Something like the off state for Data Saver that includes more helpful text. "USB devices will appear here as you grant access through browsing." Or something like that.
rolfe@ and I discussed this offline and decided to keep the automatic dismissal of UsbDevicePreferences when there are no more sites to display. She will also send the strings for UI review.
rolfe@ and I discussed this offline and decided to keep the automatic dismissal of UsbDevicePreferences when there are no more sites to display. She will also send the strings for UI review.

Comment 43 by rolfe@chromium.org, Aug 16 2016

Empty state string will be "No Bluetooth devices here"

See UI review thread for details:
https://groups.google.com/a/google.com/forum/#!topic/chrome-ui-review/-SxR3sKdgvI

Separate bug logged for the site settings one in general:
https://bugs.chromium.org/p/chromium/issues/detail?id=638291
Project Member

Comment 44 by bugdroid1@chromium.org, Aug 18 2016

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

commit e11e868ed72f931b1fc1f72df3475e5698462057
Author: reillyg <reillyg@chromium.org>
Date: Thu Aug 18 01:51:41 2016

Add a section to Site Settings listing USB devices.

The new section lists USB devices that the user has granted a website
permission to access. Tapping on a particular device brings you to the
site settings view for that site.

BUG= 601627 

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

[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/res/xml/site_settings_preferences.xml
[add] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/res/xml/usb_chooser_preferences.xml
[add] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/res/xml/usb_device_preferences.xml
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
[add] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbChooserPreferences.java
[add] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbDevicePreferences.java
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbInfo.java
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/strings/android_chrome_strings.grd
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java_sources.gni

Project Member

Comment 45 by bugdroid1@chromium.org, Aug 18 2016

Labels: merge-merged-2832
The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/e11e868ed72f931b1fc1f72df3475e5698462057

commit e11e868ed72f931b1fc1f72df3475e5698462057
Author: reillyg <reillyg@chromium.org>
Date: Thu Aug 18 01:51:41 2016

Add a section to Site Settings listing USB devices.

The new section lists USB devices that the user has granted a website
permission to access. Tapping on a particular device brings you to the
site settings view for that site.

BUG= 601627 

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

[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/res/xml/site_settings_preferences.xml
[add] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/res/xml/usb_chooser_preferences.xml
[add] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/res/xml/usb_device_preferences.xml
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsCategory.java
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/SiteSettingsPreferences.java
[add] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbChooserPreferences.java
[add] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbDevicePreferences.java
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/UsbInfo.java
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/src/org/chromium/chrome/browser/preferences/website/WebsitePermissionsFetcher.java
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java/strings/android_chrome_strings.grd
[modify] https://crrev.com/e11e868ed72f931b1fc1f72df3475e5698462057/chrome/android/java_sources.gni

Status: Fixed (was: Started)

Sign in to add a comment