OLD | NEW |
---|---|
(Empty) | |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_USB_USB_COMMON_H_ | |
6 #define CHROME_BROWSER_USB_USB_COMMON_H_ | |
7 | |
8 class GURL; | |
9 | |
10 namespace device { | |
11 struct WebUsbAllowedOrigins; | |
12 } | |
13 | |
14 // Reasons the chooser may be closed. These are used in histograms so do not | |
15 // remove/reorder entries. Only add at the end just before | |
16 // WEBUSB_CHOOSER_CLOSED_MAX. Also remember to update the enum listing in | |
17 // tools/metrics/histograms/histograms.xml. | |
18 enum WebUsbChooserClosed { | |
19 // The user cancelled the permission prompt without selecting a device. | |
20 WEBUSB_CHOOSER_CLOSED_CANCELLED = 0, | |
21 // The user probably cancelled the permission prompt without selecting a | |
22 // device because there were no devices to select. | |
23 WEBUSB_CHOOSER_CLOSED_CANCELLED_NO_DEVICES, | |
24 // The user granted permission to access a device. | |
25 WEBUSB_CHOOSER_CLOSED_PERMISSION_GRANTED, | |
26 // The user granted permission to access a device but that permission will be | |
27 // revoked when the device is disconnected. | |
28 WEBUSB_CHOOSER_CLOSED_EPHEMERAL_PERMISSION_GRANTED, | |
29 // Maximum value for the enum. | |
30 WEBUSB_CHOOSER_CLOSED_MAX | |
31 }; | |
32 | |
33 void RecordChooserClosure(WebUsbChooserClosed disposition); | |
34 | |
35 // Check if the origin is allowed. | |
36 bool FindInAllowedOrigins(const device::WebUsbAllowedOrigins* allowed_origins, | |
Reilly Grant (use Gerrit)
2016/03/04 20:53:39
These functions should have more specific names no
juncai
2016/03/05 00:18:25
Done.
| |
37 const GURL& origin); | |
38 | |
39 #endif // CHROME_BROWSER_USB_USB_COMMON_H_ | |
OLD | NEW |