OLD | NEW |
1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_RESULT_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_RESULT_H_ |
6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_RESULT_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_RESULT_H_ |
7 | 7 |
8 #include "components/content_settings/core/common/content_settings.h" | 8 #include "components/content_settings/core/common/content_settings.h" |
9 | 9 |
10 // Identifies the source or reason for a permission status being returned. | 10 // Identifies the source or reason for a permission status being returned. |
11 enum class PermissionStatusSource { | 11 enum class PermissionStatusSource { |
12 // The reason for the status is not specified. | 12 // The reason for the status is not specified. |
13 UNSPECIFIED, | 13 UNSPECIFIED, |
14 | 14 |
15 // The status is the result of being blocked because the permission is on the | 15 // The status is the result of being blocked because the permission is on the |
16 // safe browsing blacklist. | 16 // safe browsing blacklist. |
17 SAFE_BROWSING_BLACKLIST, | 17 SAFE_BROWSING_BLACKLIST, |
18 | 18 |
19 // The status is the result of being blocked by the permissions kill switch. | 19 // The status is the result of being blocked by the permissions kill switch. |
20 KILL_SWITCH, | 20 KILL_SWITCH, |
21 | 21 |
22 // The status is the result of being blocked due to the user dismissing a | 22 // The status is the result of being blocked due to the user dismissing a |
23 // permission prompt multiple times. | 23 // permission prompt multiple times. |
24 MULTIPLE_DISMISSALS, | 24 MULTIPLE_DISMISSALS, |
25 | 25 |
26 // The status is the result of being blocked due to the user ignoring a | 26 // The status is the result of being blocked due to the user ignoring a |
27 // permission prompt multiple times. | 27 // permission prompt multiple times. |
28 MULTIPLE_IGNORES, | 28 MULTIPLE_IGNORES, |
| 29 |
| 30 // This origin is insecure, thus its access to some permissions has been |
| 31 // restricted, such as camera, microphone, etc. |
| 32 INSECURE_ORIGIN, |
| 33 |
| 34 // The following two PermissionStatusSources cover the permission being |
| 35 // individually controlled for a certain origin, or are part of a group of |
| 36 // origins controlled via a URL pattern, e.g. "https://*". |
| 37 |
| 38 // Controlled by enterprise policy. |
| 39 ENTERPRISE_POLICY, |
| 40 |
| 41 // Controlled by an extension. |
| 42 EXTENSION, |
29 }; | 43 }; |
30 | 44 |
31 struct PermissionResult { | 45 struct PermissionResult { |
32 PermissionResult(ContentSetting content_setting, | 46 PermissionResult(ContentSetting content_setting, |
33 PermissionStatusSource source); | 47 PermissionStatusSource source); |
34 ~PermissionResult(); | 48 ~PermissionResult(); |
35 | 49 |
36 ContentSetting content_setting; | 50 ContentSetting content_setting; |
37 PermissionStatusSource source; | 51 PermissionStatusSource source; |
38 }; | 52 }; |
39 | 53 |
40 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_RESULT_H_ | 54 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_RESULT_H_ |
OLD | NEW |