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

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

Issue 2640033006: Convert AutoBlocker static class to KeyedService. (Closed)
Patch Set: Reformat conversion method + 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
« no previous file with comments | « chrome/browser/permissions/permission_util.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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) {
« no previous file with comments | « chrome/browser/permissions/permission_util.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698