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

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

Issue 1388343003: Adds a field trial to control Web API kill switches. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 5 years, 2 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') | chrome/chrome_browser.gypi » ('j') | 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
new file mode 100644
index 0000000000000000000000000000000000000000..d7d77eb56a4b9fe2ce35b48309c8bba6edef3178
--- /dev/null
+++ b/chrome/browser/permissions/permission_util.cc
@@ -0,0 +1,37 @@
+// 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"
+
+#include "base/logging.h"
+
+// 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(
+ 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 std::string();
+ }
+}
« no previous file with comments | « chrome/browser/permissions/permission_util.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698