Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(132)

Issue 599303004: Add getUserSelectedDevices to the USB extensions API. (Closed)

Created:
6 years, 3 months ago by Reilly Grant (use Gerrit)
Modified:
6 years, 2 months ago
CC:
chromium-reviews, extensions-reviews_chromium.org, tfarina, yurys, paulirish+reviews_chromium.org, arv+watch_chromium.org, asvitkine+watch_chromium.org, devtools-reviews_chromium.org, chromium-apps-reviews_chromium.org, aandrey+blink_chromium.org, pfeldman
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

Add getUserSelectedDevices to the USB extensions API. chrome.usb.getUserSelectedDevices allows an app to prompt the user for one or more USB devices for it to access. This is an alternative to statically declaring the list of devices an app can access in the application manifest. This is useful for device classes such as ADB-enabled Android devices which may have a great number of vendor and product ID pairs but all match a well-known interface protocol. If a selected device has a serial number then the app can retain access to it until explicitly revoked (as is the case for most Android phones) while access to a device without a serial number is revoked when the app is unloaded or the device is disconnected. BUG=346953 Committed: https://crrev.com/042073be6f85951049a6a3a4f84499ab85109566 Cr-Commit-Position: refs/heads/master@{#300141}

Patch Set 1 : #

Total comments: 8

Patch Set 2 : Improve future expandability of the API and fix a memory leak. #

Total comments: 1

Patch Set 3 : Rename UsbDevicesChosen -> OnUsbDevicesChosen #

Patch Set 4 : Rebased. #

Patch Set 5 : Indirect through ExtensionsAPIClient to fix linking in app_shell. #

Patch Set 6 : Add device_permissions_prompt.* to BUILD.gn. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+229 lines, -98 lines) Patch
A chrome/browser/extensions/api/chrome_device_permissions_prompt.h View 1 2 3 4 1 chunk +22 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/chrome_extensions_api_client.h View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M chrome/browser/extensions/api/chrome_extensions_api_client.cc View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M chrome/browser/ui/cocoa/extensions/device_permissions_dialog_controller.mm View 1 2 3 4 3 chunks +4 lines, -16 lines 0 comments Download
M chrome/browser/ui/views/extensions/device_permissions_dialog_view.cc View 1 2 3 4 3 chunks +5 lines, -17 lines 0 comments Download
M chrome/chrome_browser_extensions.gypi View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M extensions/browser/BUILD.gn View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M extensions/browser/api/device_permissions_prompt.h View 1 2 3 4 1 chunk +12 lines, -13 lines 0 comments Download
M extensions/browser/api/device_permissions_prompt.cc View 1 2 3 4 2 chunks +2 lines, -3 lines 0 comments Download
M extensions/browser/api/extensions_api_client.h View 1 2 3 4 1 chunk +4 lines, -0 lines 0 comments Download
M extensions/browser/api/extensions_api_client.cc View 1 2 3 4 2 chunks +7 lines, -0 lines 0 comments Download
M extensions/browser/api/usb/usb_api.h View 1 2 4 chunks +26 lines, -9 lines 0 comments Download
M extensions/browser/api/usb/usb_api.cc View 1 2 3 4 13 chunks +109 lines, -39 lines 0 comments Download
M extensions/browser/extension_function_histogram_value.h View 1 chunk +1 line, -0 lines 0 comments Download
M extensions/common/api/_api_features.json View 1 chunk +5 lines, -0 lines 0 comments Download
M extensions/common/api/usb.idl View 1 3 chunks +19 lines, -1 line 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 21 (6 generated)
Reilly Grant (use Gerrit)
Please take a look. This is the new API itself.
6 years, 2 months ago (2014-10-15 00:20:58 UTC) #4
Finnur
I'm probably not the ideal candidate to review this. Is there nobody on the extension ...
6 years, 2 months ago (2014-10-15 09:33:08 UTC) #5
Finnur
> One question about the file picker. Just noticed the other CL.
6 years, 2 months ago (2014-10-15 09:34:14 UTC) #6
Reilly Grant (use Gerrit)
On 2014/10/15 09:33:08, Finnur wrote: > I'm probably not the ideal candidate to review this. ...
6 years, 2 months ago (2014-10-15 19:12:27 UTC) #7
Reilly Grant (use Gerrit)
https://codereview.chromium.org/599303004/diff/40001/extensions/browser/api/usb/usb_api.cc File extensions/browser/api/usb/usb_api.cc (right): https://codereview.chromium.org/599303004/diff/40001/extensions/browser/api/usb/usb_api.cc#newcode479 extensions/browser/api/usb/usb_api.cc:479: } On 2014/10/15 09:33:08, Finnur wrote: > Nit: No ...
6 years, 2 months ago (2014-10-15 19:12:43 UTC) #8
Finnur
> Style Guide: "In general, curly braces are not required for single-line > statements, but ...
6 years, 2 months ago (2014-10-16 09:15:23 UTC) #9
Reilly Grant (use Gerrit)
Alexei, please take a look at the extension function histogram changes.
6 years, 2 months ago (2014-10-16 17:32:23 UTC) #11
Alexei Svitkine (slow)
lgtm
6 years, 2 months ago (2014-10-16 17:34:14 UTC) #12
Reilly Grant (use Gerrit)
Ken, please take a look at the latest diff. I've updated the API to use ...
6 years, 2 months ago (2014-10-16 19:05:09 UTC) #14
Ken Rockot(use gerrit already)
lgtm https://codereview.chromium.org/599303004/diff/60001/extensions/browser/api/usb/usb_api.h File extensions/browser/api/usb/usb_api.h (right): https://codereview.chromium.org/599303004/diff/60001/extensions/browser/api/usb/usb_api.h#newcode120 extensions/browser/api/usb/usb_api.h:120: virtual void UsbDevicesChosen( optional nit: I kind of ...
6 years, 2 months ago (2014-10-16 19:15:23 UTC) #15
Reilly Grant (use Gerrit)
Ken, please take a look at the ExtensionsAPIClient redirection I've added to fix the app_shell ...
6 years, 2 months ago (2014-10-17 17:52:22 UTC) #16
Ken Rockot(use gerrit already)
Nice. LGTM
6 years, 2 months ago (2014-10-17 18:28:37 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/599303004/140001
6 years, 2 months ago (2014-10-17 18:33:00 UTC) #19
commit-bot: I haz the power
Committed patchset #6 (id:140001)
6 years, 2 months ago (2014-10-17 19:20:52 UTC) #20
commit-bot: I haz the power
6 years, 2 months ago (2014-10-17 19:22:01 UTC) #21
Message was sent while issue was closed.
Patchset 6 (id:??) landed as
https://crrev.com/042073be6f85951049a6a3a4f84499ab85109566
Cr-Commit-Position: refs/heads/master@{#300141}

Powered by Google App Engine
This is Rietveld 408576698