blob: 974dd8c0daa6df8cb545215adba0839b04969610 [file] [log] [blame]
[email protected]efad90f2014-01-17 00:45:541// Copyright 2014 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
tsergeant58defcfb2016-07-19 23:47:285#ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_
6#define CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_H_
[email protected]efad90f2014-01-17 00:45:547
dominicknd4e446a2016-09-13 07:44:138#include "base/macros.h"
[email protected]efad90f2014-01-17 00:45:549#include "base/strings/string16.h"
lshangada00c12016-10-17 04:51:1010#include "components/content_settings/core/common/content_settings_types.h"
[email protected]d23cdeee2014-03-10 06:39:5311#include "url/gurl.h"
[email protected]efad90f2014-01-17 00:45:5412
estade292df4f82015-07-31 18:53:2513namespace gfx {
estade1e235b62017-02-15 01:40:3414struct VectorIcon;
estade292df4f82015-07-31 18:53:2515}
16
benwells46b02fa2016-04-20 02:37:0217// Used for UMA to record the types of permission prompts shown.
Adam Langley5472afb2018-01-10 00:07:4018// When updating, you also need to update:
19// 1) The PermissionRequestType enum in tools/metrics/histograms/enums.xml.
20// 2) The PermissionRequestTypes suffix list in
21// tools/metrics/histograms/histograms.xml.
22// 3) GetPermissionRequestString in
23// chrome/browser/permissions/permission_uma_util.cc.
24//
25// The usual rules of updating UMA values applies to this enum:
benwells46b02fa2016-04-20 02:37:0226// - don't remove values
27// - only ever add values at the end
tsergeant58defcfb2016-07-19 23:47:2828enum class PermissionRequestType {
cm.sanchi761e67a2017-11-16 08:23:2829 UNKNOWN = 0,
30 MULTIPLE = 1,
Timothy Lohbbd67f72017-12-12 06:14:5031 // UNUSED_PERMISSION = 2,
cm.sanchi761e67a2017-11-16 08:23:2832 QUOTA = 3,
33 DOWNLOAD = 4,
Timothy Lohbbd67f72017-12-12 06:14:5034 // MEDIA_STREAM = 5,
cm.sanchi761e67a2017-11-16 08:23:2835 REGISTER_PROTOCOL_HANDLER = 6,
36 PERMISSION_GEOLOCATION = 7,
37 PERMISSION_MIDI_SYSEX = 8,
38 PERMISSION_NOTIFICATIONS = 9,
39 PERMISSION_PROTECTED_MEDIA_IDENTIFIER = 10,
40 // PERMISSION_PUSH_MESSAGING = 11,
41 PERMISSION_FLASH = 12,
42 PERMISSION_MEDIASTREAM_MIC = 13,
43 PERMISSION_MEDIASTREAM_CAMERA = 14,
44 PERMISSION_ACCESSIBILITY_EVENTS = 15,
Darwin Huangf6661742019-12-06 23:31:3145 // PERMISSION_CLIPBOARD_READ = 16, // Replaced by
46 // PERMISSION_CLIPBOARD_READ_WRITE in M81.
Adam Langley5472afb2018-01-10 00:07:4047 PERMISSION_SECURITY_KEY_ATTESTATION = 17,
Jinho Bang22de3a92018-02-27 18:16:2248 PERMISSION_PAYMENT_HANDLER = 18,
Francois Beaufortdbb86fd2019-11-22 14:29:0949 PERMISSION_NFC = 19,
Darwin Huangf6661742019-12-06 23:31:3150 PERMISSION_CLIPBOARD_READ_WRITE = 20,
benwells46b02fa2016-04-20 02:37:0251 // NUM must be the last value in the enum.
52 NUM
53};
54
benwells471d1f12016-07-25 23:58:0455// Used for UMA to record whether a gesture was associated with the request. For
56// simplicity not all request types track whether a gesture is associated with
57// it or not, for these types of requests metrics are not recorded.
58enum class PermissionRequestGestureType {
59 UNKNOWN,
60 GESTURE,
61 NO_GESTURE,
62 // NUM must be the last value in the enum.
63 NUM
64};
65
tsergeant58defcfb2016-07-19 23:47:2866// Describes the interface a feature making permission requests should
67// implement. A class of this type is registered with the permission request
[email protected]efad90f2014-01-17 00:45:5468// manager to receive updates about the result of the permissions request
tsergeant58defcfb2016-07-19 23:47:2869// from the bubble or infobar. It should live until it is unregistered or until
[email protected]634e5982014-04-18 19:20:4870// RequestFinished is called.
[email protected]efad90f2014-01-17 00:45:5471// Note that no particular guarantees are made about what exact UI surface
72// is presented to the user. The delegate may be coalesced with other bubble
73// requests, or depending on the situation, not shown at all.
tsergeant58defcfb2016-07-19 23:47:28