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

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

Issue 2640033006: Convert AutoBlocker static class to KeyedService. (Closed)
Patch Set: Remove static methods, nits Created 3 years, 11 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
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);

Powered by Google App Engine
This is Rietveld 408576698