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

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

Issue 2714603002: Make PermissionManager use ContentSettingsType internally more (Closed)
Patch Set: address comments 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
Index: chrome/browser/permissions/permission_util.cc
diff --git a/chrome/browser/permissions/permission_util.cc b/chrome/browser/permissions/permission_util.cc
index 955b2f64cc96c63ed857d6b35d0f1e6ef2316256..a49e5f262662adccd06e05e8e2ed2fb71ccf371a 100644
--- a/chrome/browser/permissions/permission_util.cc
+++ b/chrome/browser/permissions/permission_util.cc
@@ -15,41 +15,33 @@
using content::PermissionType;
-std::string PermissionUtil::GetPermissionString(
- ContentSettingsType content_type) {
- PermissionType permission_type;
- bool success = PermissionUtil::GetPermissionType(
- content_type, &permission_type);
- DCHECK(success);
- return GetPermissionString(permission_type);
-}
-
// The returned strings must match the RAPPOR metrics in rappor.xml,
// and any Field Trial configs for the Permissions kill switch e.g.
// Permissions.Action.Geolocation etc..
-std::string PermissionUtil::GetPermissionString(PermissionType permission) {
- switch (permission) {
- case PermissionType::GEOLOCATION:
+std::string PermissionUtil::GetPermissionString(
+ ContentSettingsType content_type) {
+ switch (content_type) {
+ case CONTENT_SETTINGS_TYPE_GEOLOCATION:
return "Geolocation";
- case PermissionType::NOTIFICATIONS:
+ case CONTENT_SETTINGS_TYPE_NOTIFICATIONS:
return "Notifications";
- case PermissionType::MIDI_SYSEX:
+ case CONTENT_SETTINGS_TYPE_MIDI_SYSEX:
return "MidiSysEx";
- case PermissionType::PUSH_MESSAGING:
+ case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING:
return "PushMessaging";
- case PermissionType::DURABLE_STORAGE:
+ case CONTENT_SETTINGS_TYPE_DURABLE_STORAGE:
return "DurableStorage";
- case PermissionType::PROTECTED_MEDIA_IDENTIFIER:
+ case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER:
return "ProtectedMediaIdentifier";
- case PermissionType::AUDIO_CAPTURE:
+ case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC:
return "AudioCapture";
- case PermissionType::VIDEO_CAPTURE:
+ case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA:
return "VideoCapture";
- case PermissionType::MIDI:
+ case CONTENT_SETTINGS_TYPE_MIDI:
return "Midi";
- case PermissionType::BACKGROUND_SYNC:
+ case CONTENT_SETTINGS_TYPE_BACKGROUND_SYNC:
return "BackgroundSync";
- case PermissionType::FLASH:
+ case CONTENT_SETTINGS_TYPE_PLUGINS:
return "Flash";
default:
break;
« no previous file with comments | « chrome/browser/permissions/permission_util.h ('k') | components/content_settings/core/common/content_settings_types.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698