Block the WebUSB chooser when the guard permission is 'block'

This change adds logic to the WebUSB device chooser (on desktop) so that
when the WebUSB guard permission is set to 'block' the chooser will be
automatically dismissed as if the user had not selected any devices.

This matches the behavior of the Web Bluetooth chooser and its guard
permission.

To test this change the WebUsbChooserService class has been refactored
so that its shared logic can be reused by tests. A follow-up patch will
make WebUsbChooserServiceAndroid also inherit from this class.

Bug: 771703
Change-Id: I3f2cc6e96a9ebf039bc15d396d16eb4a0766007e
Reviewed-on: https://chromium-review.googlesource.com/987327
Commit-Queue: Reilly Grant <[email protected]>
Reviewed-by: Jun Cai <[email protected]>
Cr-Commit-Position: refs/heads/master@{#547338}
7 files changed