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 |
| index 0643a0f7fc9c37a247e5ce3d82ab37e6f0a642f3..134d2f1820aa423e33c486deb7a6dbbf263a6bff 100644 |
| --- a/chrome/browser/permissions/permission_util.cc |
| +++ b/chrome/browser/permissions/permission_util.cc |
| @@ -55,6 +55,34 @@ std::string PermissionUtil::GetPermissionString( |
| return std::string(); |
| } |
| +std::string PermissionUtil::ConvertPermissionTypeToSafeBrowsingName( |
| + const content::PermissionType& permission_type) { |
| + if (permission_type == content::PermissionType::GEOLOCATION) |
|
raymes
2017/01/24 23:44:23
Please convert this to a switch statement as in Ge
meredithl
2017/01/25 00:21:10
Done.
|
| + return "GEOLOCATION"; |
| + if (permission_type == content::PermissionType::NOTIFICATIONS) |
| + return "NOTIFICATIONS"; |
| + if (permission_type == content::PermissionType::MIDI_SYSEX) |
| + return "MIDI_SYSEX"; |
| + if (permission_type == content::PermissionType::PUSH_MESSAGING) |
| + return "PUSH_MESSAGING"; |
| + if (permission_type == content::PermissionType::DURABLE_STORAGE) |
| + return "DURABLE_STORAGE"; |
| + if (permission_type == content::PermissionType::PROTECTED_MEDIA_IDENTIFIER) |
| + return "PROTECTED_MEDIA_IDENTIFIER"; |
| + if (permission_type == content::PermissionType::AUDIO_CAPTURE) |
| + return "AUDIO_CAPTURE"; |
| + if (permission_type == content::PermissionType::MIDI) |
|
raymes
2017/01/24 23:44:23
MIDI->VIDEO_CAPTURE
meredithl
2017/01/25 00:21:10
Done.
|
| + return "VIDEO_CAPTURE"; |
| + if (permission_type == content::PermissionType::MIDI) |
| + return "MIDI"; |
| + if (permission_type == content::PermissionType::BACKGROUND_SYNC) |
| + return "BACKGROUND_SYNC"; |
| + if (permission_type == content::PermissionType::FLASH) |
| + return "FLASH"; |
| + NOTREACHED(); |
| + return std::string(); |
| +} |
| + |
| PermissionRequestType PermissionUtil::GetRequestType( |
| content::PermissionType type) { |
| switch (type) { |