| 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" |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 59 // to remove the usage in PermissionUmaUtil, which uses PermissionType as a | 59 // to remove the usage in PermissionUmaUtil, which uses PermissionType as a |
| 60 // histogram value to count permission request metrics. | 60 // histogram value to count permission request metrics. |
| 61 static bool GetPermissionType(ContentSettingsType type, | 61 static bool GetPermissionType(ContentSettingsType type, |
| 62 content::PermissionType* out); | 62 content::PermissionType* out); |
| 63 | 63 |
| 64 // Checks whether the given ContentSettingsType is a permission. Use this | 64 // Checks whether the given ContentSettingsType is a permission. Use this |
| 65 // to determine whether a specific ContentSettingsType is supported by the | 65 // to determine whether a specific ContentSettingsType is supported by the |
| 66 // PermissionManager. | 66 // PermissionManager. |
| 67 static bool IsPermission(ContentSettingsType type); | 67 static bool IsPermission(ContentSettingsType type); |
| 68 | 68 |
| 69 static bool ShouldShowPersistenceToggle(); | 69 static bool ShouldShowPersistenceToggle(ContentSettingsType type); |
| 70 | 70 |
| 71 // A scoped class that will check the current resolved content setting on | 71 // A scoped class that will check the current resolved content setting on |
| 72 // construction and report a revocation metric accordingly if the revocation | 72 // construction and report a revocation metric accordingly if the revocation |
| 73 // condition is met (from ALLOW to something else). | 73 // condition is met (from ALLOW to something else). |
| 74 class ScopedRevocationReporter { | 74 class ScopedRevocationReporter { |
| 75 public: | 75 public: |
| 76 ScopedRevocationReporter(Profile* profile, | 76 ScopedRevocationReporter(Profile* profile, |
| 77 const GURL& primary_url, | 77 const GURL& primary_url, |
| 78 const GURL& secondary_url, | 78 const GURL& secondary_url, |
| 79 ContentSettingsType content_type, | 79 ContentSettingsType content_type, |
| (...skipping 14 matching lines...) Expand all Loading... |
| 94 ContentSettingsType content_type_; | 94 ContentSettingsType content_type_; |
| 95 PermissionSourceUI source_ui_; | 95 PermissionSourceUI source_ui_; |
| 96 bool is_initially_allowed_; | 96 bool is_initially_allowed_; |
| 97 }; | 97 }; |
| 98 | 98 |
| 99 private: | 99 private: |
| 100 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); | 100 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); |
| 101 }; | 101 }; |
| 102 | 102 |
| 103 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ | 103 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ |
| OLD | NEW |