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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
54 static PermissionRequestGestureType GetGestureType(bool user_gesture); | 54 static PermissionRequestGestureType GetGestureType(bool user_gesture); |
55 | 55 |
56 // Limited conversion of ContentSettingsType to PermissionType. Returns true | 56 // Limited conversion of ContentSettingsType to PermissionType. Returns true |
57 // if the conversion was performed. | 57 // if the conversion was performed. |
58 // TODO(timloh): Try to remove this function. Mainly we need to work out how | 58 // TODO(timloh): Try to remove this function. Mainly we need to work out how |
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. | |
65 static bool IsPermission(ContentSettingsType type); | |
dominickn
2017/03/03 03:31:36
Perhaps move this method to the anonymous namespac
Patti Lor
2017/03/03 05:16:32
I used this in website_settings.cc as well D:
Wha
| |
66 | |
64 static bool ShouldShowPersistenceToggle(); | 67 static bool ShouldShowPersistenceToggle(); |
65 | 68 |
66 // A scoped class that will check the current resolved content setting on | 69 // A scoped class that will check the current resolved content setting on |
67 // construction and report a revocation metric accordingly if the revocation | 70 // construction and report a revocation metric accordingly if the revocation |
68 // condition is met (from ALLOW to something else). | 71 // condition is met (from ALLOW to something else). |
69 class ScopedRevocationReporter { | 72 class ScopedRevocationReporter { |
70 public: | 73 public: |
71 ScopedRevocationReporter(Profile* profile, | 74 ScopedRevocationReporter(Profile* profile, |
72 const GURL& primary_url, | 75 const GURL& primary_url, |
73 const GURL& secondary_url, | 76 const GURL& secondary_url, |
(...skipping 15 matching lines...) Expand all Loading... | |
89 ContentSettingsType content_type_; | 92 ContentSettingsType content_type_; |
90 PermissionSourceUI source_ui_; | 93 PermissionSourceUI source_ui_; |
91 bool is_initially_allowed_; | 94 bool is_initially_allowed_; |
92 }; | 95 }; |
93 | 96 |
94 private: | 97 private: |
95 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); | 98 DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); |
96 }; | 99 }; |
97 | 100 |
98 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ | 101 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_UTIL_H_ |
OLD | NEW |