Chromium Code Reviews| Index: chrome/browser/permissions/permission_util.cc |
| diff --git a/chrome/browser/permissions/permission_util.cc b/chrome/browser/permissions/permission_util.cc |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..5e05e1f5a36b40d4f7d81e0374315d3248df4288 |
| --- /dev/null |
| +++ b/chrome/browser/permissions/permission_util.cc |
| @@ -0,0 +1,35 @@ |
| +// Copyright 2015 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#include "chrome/browser/permissions/permission_util.h" |
| + |
| +// The returned strings must match the RAPPOR metrics in rappor.xml, |
| +// and any Finch configs for the Permissions kill switch e.g. |
| +// Permissions.Action.Geolocation etc.. |
|
mlamouri (slow - plz ping)
2015/10/21 11:26:06
nit: it shouldn't match RAPPOR and Finch but the o
kcarattini
2015/10/26 00:30:59
The comment was meant for people editing the code
|
| +const std::string PermissionUtil::GetPermissionString( |
| + ContentSettingsType permission) { |
| + switch (permission) { |
| + case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
| + return "Geolocation"; |
| + case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
| + return "Notifications"; |
| + case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: |
| + return "MidiSysEx"; |
| + case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING: |
| + return "PushMessaging"; |
| + case CONTENT_SETTINGS_TYPE_DURABLE_STORAGE: |
| + return "DurableStorage"; |
| +#if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| + case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: |
| + return "ProtectedMediaIdentifier"; |
| +#endif |
| + case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: |
| + return "AudioCapture"; |
| + case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: |
| + return "VideoCapture"; |
| + default: |
| + NOTREACHED(); |
| + return ""; |
|
Bernhard Bauer
2015/10/21 10:29:04
Use an empty std::string() constructor to save a c
kcarattini
2015/10/26 00:30:59
Done.
|
| + } |
| +} |