Index: chrome/browser/permissions/permission_util.h |
diff --git a/chrome/browser/permissions/permission_util.h b/chrome/browser/permissions/permission_util.h |
index 7e482d846b1f68f5e990bc325c746b95e412e66f..46ff8036e59a623e1aa05841b9644ccf984bb049 100644 |
--- a/chrome/browser/permissions/permission_util.h |
+++ b/chrome/browser/permissions/permission_util.h |
@@ -15,6 +15,21 @@ |
class Profile; |
+// Anonymous namespace for internal constants. |
+namespace { |
+ const char kGeolocationPermissionName[] = "Geolocation"; |
+ const char kNotificationPermissionName[] = "Notifications"; |
+ const char kMidiSysExnPermissionName[] = "MidiSysEx"; |
+ const char kPushMessagingPermissionName[] = "PushMessaging"; |
+ const char kDurableStoragePermissionName[] = "DurableStorage"; |
+ const char kProtectedMediaPermissionName[] = "ProtectedMediaIdentifier"; |
+ const char kAudioCapturePermissionName[] = "AudioCapture"; |
+ const char kVideoCapturePermissionName[] = "VideoCapture"; |
+ const char kMidiPermissionName[] = "Midi"; |
+ const char kBackgroundSyncPermissionName[] = "BackgroundSync"; |
+ const char kFlashPermissionName[] = "Flash"; |
raymes
2017/01/24 05:15:17
Is it necessary to define these as constants?
meredithl
2017/01/24 23:20:21
Not since I've changed the conversion to return a
|
+} // namespace |
+ |
namespace content { |
enum class PermissionType; |
} // namespace content |
@@ -45,6 +60,11 @@ class PermissionUtil { |
// Returns the permission string for the given PermissionType. |
static std::string GetPermissionString(content::PermissionType permission); |
+ // Converts between the stringified PermissionType enum that Safe Browsing |
+ // returns to a content::PermissionType. |
+ static content::PermissionType ConvertSafeBrowsingNameToPermissionType( |
+ const std::string& sb_name); |
+ |
// Returns the request type corresponding to a permission type. |
static PermissionRequestType GetRequestType(content::PermissionType type); |