blob: 84805b38fad60e9b96d4734adf0d2d4b9e371173 [file] [log] [blame]
juncai4cbad6e2016-03-25 20:40:351// 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_WEB_USB_HISTOGRAMS_H_
6#define CHROME_BROWSER_USB_WEB_USB_HISTOGRAMS_H_
7
8// Reasons the chooser may be closed. These are used in histograms so do not
9// remove/reorder entries. Only add at the end just before
10// WEBUSB_CHOOSER_CLOSED_MAX. Also remember to update the enum listing in
11// tools/metrics/histograms/histograms.xml.
12enum WebUsbChooserClosed {
13 // The user cancelled the permission prompt without selecting a device.
14 WEBUSB_CHOOSER_CLOSED_CANCELLED = 0,
15 // The user probably cancelled the permission prompt without selecting a
16 // device because there were no devices to select.
17 WEBUSB_CHOOSER_CLOSED_CANCELLED_NO_DEVICES,
18 // The user granted permission to access a device.
19 WEBUSB_CHOOSER_CLOSED_PERMISSION_GRANTED,
20 // The user granted permission to access a device but that permission will be
21 // revoked when the device is disconnected.
22 WEBUSB_CHOOSER_CLOSED_EPHEMERAL_PERMISSION_GRANTED,
23 // Maximum value for the enum.
24 WEBUSB_CHOOSER_CLOSED_MAX
25};
26
27void RecordWebUsbChooserClosure(WebUsbChooserClosed disposition);
28
29#endif // CHROME_BROWSER_USB_WEB_USB_HISTOGRAMS_H_