OLD | NEW |
(Empty) | |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "chrome/browser/permissions/permission_util.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 |
| 9 // The returned strings must match the RAPPOR metrics in rappor.xml, |
| 10 // and any Field Trial configs for the Permissions kill switch e.g. |
| 11 // Permissions.Action.Geolocation etc.. |
| 12 std::string PermissionUtil::GetPermissionString( |
| 13 ContentSettingsType permission) { |
| 14 switch (permission) { |
| 15 case CONTENT_SETTINGS_TYPE_GEOLOCATION: |
| 16 return "Geolocation"; |
| 17 case CONTENT_SETTINGS_TYPE_NOTIFICATIONS: |
| 18 return "Notifications"; |
| 19 case CONTENT_SETTINGS_TYPE_MIDI_SYSEX: |
| 20 return "MidiSysEx"; |
| 21 case CONTENT_SETTINGS_TYPE_PUSH_MESSAGING: |
| 22 return "PushMessaging"; |
| 23 case CONTENT_SETTINGS_TYPE_DURABLE_STORAGE: |
| 24 return "DurableStorage"; |
| 25 #if defined(OS_ANDROID) || defined(OS_CHROMEOS) |
| 26 case CONTENT_SETTINGS_TYPE_PROTECTED_MEDIA_IDENTIFIER: |
| 27 return "ProtectedMediaIdentifier"; |
| 28 #endif |
| 29 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_MIC: |
| 30 return "AudioCapture"; |
| 31 case CONTENT_SETTINGS_TYPE_MEDIASTREAM_CAMERA: |
| 32 return "VideoCapture"; |
| 33 default: |
| 34 NOTREACHED(); |
| 35 return std::string(); |
| 36 } |
| 37 } |
OLD | NEW |