| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_UTIL_H_ | 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ |
| 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ | 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 #include "chrome/browser/permissions/permission_request.h" | 11 #include "chrome/browser/permissions/permission_request.h" |
| 12 #include "components/content_settings/core/common/content_settings.h" | 12 #include "components/content_settings/core/common/content_settings.h" |
| 13 #include "components/content_settings/core/common/content_settings_types.h" | 13 #include "components/content_settings/core/common/content_settings_types.h" |
| 14 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 15 | 15 |
| 16 class Profile; | 16 class Profile; |
| 17 | 17 |
| 18 namespace content { | 18 namespace content { |
| 19 enum class PermissionType; | 19 enum class PermissionType; |
| 20 } // namespace content | 20 } // namespace content |
| 21 | 21 |
| 22 enum class PermissionSourceUI; | 22 enum class PermissionSourceUI; |
| 23 | 23 |
| 24 // This enum backs a UMA histogram, so it must be treated as append-only. | 24 // This enum backs a UMA histogram, so it must be treated as append-only. |
| 25 enum PermissionAction { | 25 enum class PermissionAction { |
| 26 GRANTED = 0, | 26 GRANTED = 0, |
| 27 DENIED = 1, | 27 DENIED = 1, |
| 28 DISMISSED = 2, | 28 DISMISSED = 2, |
| 29 IGNORED = 3, | 29 IGNORED = 3, |
| 30 REVOKED = 4, | 30 REVOKED = 4, |
| 31 REENABLED = 5, | 31 REENABLED = 5, |
| 32 REQUESTED = 6, | 32 REQUESTED = 6, |
| 33 | 33 |
| 34 // Always keep this at the end. | 34 // Always keep this at the end. |
| 35 PERMISSION_ACTION_NUM, | 35 NUM, |
| 36 }; | 36 }; |
| 37 | 37 |
| 38 // Identifies the source or reason for a permission status being returned. This | 38 // Identifies the source or reason for a permission status being returned. This |
| 39 // enum backs an UMA histogram and must be treated as append-only. | 39 // enum backs an UMA histogram and must be treated as append-only. |
| 40 enum class PermissionStatusSource { | 40 enum class PermissionStatusSource { |
| 41 // The reason for the status is not specified. | 41 // The reason for the status is not specified. |
| 42 UNSPECIFIED, | 42 UNSPECIFIED, |
| 43 | 43 |
| 44 // The status is the result of being blocked due to the user dismissing a | 44 // The status is the result of being blocked due to the user dismissing a |
| 45 // permission prompt multiple times. | 45 // permission prompt multiple times. |
| (...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 116 ContentSettingsType content_type_; | 116 ContentSettingsType content_type_; |
| 117 PermissionSourceUI source_ui_; | 117 PermissionSourceUI source_ui_; |
| 118 bool is_initially_allowed_; | 118 bool is_initially_allowed_; |
| 119 }; | 119 }; |
| 120 | 120 |
| 121 private: | 121 private: |
| 122 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); | 122 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); |
| 123 }; | 123 }; |
| 124 | 124 |
| 125 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ | 125 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ |
| OLD | NEW |