Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(119)

Unified Diff: chrome/browser/permissions/permission_util.h

Issue 2675483002: Replace PermissionType in chrome/ with ContentSettingsType (Closed)
Patch Set: rebase + include content_settings_types.h more Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/permissions/permission_uma_util.cc ('k') | chrome/browser/permissions/permission_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/permissions/permission_util.h
diff --git a/chrome/browser/permissions/permission_util.h b/chrome/browser/permissions/permission_util.h
index 2ad0c7ed2462063d80ca24407a5ecba639bd096a..b8faf9417ee6085d3141b6bfccbc060073bc519e 100644
--- a/chrome/browser/permissions/permission_util.h
+++ b/chrome/browser/permissions/permission_util.h
@@ -35,34 +35,32 @@ enum PermissionAction {
PERMISSION_ACTION_NUM,
};
-struct PermissionTypeHash {
- std::size_t operator()(const content::PermissionType& type) const;
-};
-
// A utility class for permissions.
class PermissionUtil {
public:
- // Returns the permission string for the given PermissionType.
- static std::string GetPermissionString(content::PermissionType permission);
+ // Returns the permission string for the given permission.
+ static std::string GetPermissionString(ContentSettingsType);
+ // TODO(timloh): Remove this content::PermissionType overload when we add MIDI
+ // to ContentSettingsType.
+ static std::string GetPermissionString(content::PermissionType);
- // Return the stringified version of the PermissionType enum that Safe
- // Browsing uses for the API Blacklist.
- static std::string ConvertPermissionTypeToSafeBrowsingName(
- const content::PermissionType& permission_type);
+ // Return the stringified version of the ContentSettingsType enum that
+ // Safe Browsing uses for the API Blacklist.
+ static std::string ConvertContentSettingsTypeToSafeBrowsingName(
+ ContentSettingsType permission);
// Returns the request type corresponding to a permission type.
- static PermissionRequestType GetRequestType(content::PermissionType type);
+ static PermissionRequestType GetRequestType(ContentSettingsType permission);
// Returns the gesture type corresponding to whether a permission request is
// made with or without a user gesture.
static PermissionRequestGestureType GetGestureType(bool user_gesture);
- // Limited conversion of ContentSettingsType to PermissionType. Intended for
- // recording Permission UMA metrics from areas of the codebase which have not
- // yet been converted to PermissionType. Returns true if the conversion was
- // performed.
- // TODO(tsergeant): Remove this function once callsites operate on
- // PermissionType directly.
+ // Limited conversion of ContentSettingsType to PermissionType. Returns true
+ // if the conversion was performed.
+ // TODO(timloh): Try to remove this function. Mainly we need to work out how
+ // to remove the usage in PermissionUmaUtil, which uses PermissionType as a
+ // histogram value to count permission request metrics.
static bool GetPermissionType(ContentSettingsType type,
content::PermissionType* out);
« no previous file with comments | « chrome/browser/permissions/permission_uma_util.cc ('k') | chrome/browser/permissions/permission_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698