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

Unified Diff: chrome/browser/permissions/permission_context_base.h

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: Review Comments 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
Index: chrome/browser/permissions/permission_context_base.h
diff --git a/chrome/browser/permissions/permission_context_base.h b/chrome/browser/permissions/permission_context_base.h
index 440880b957d9a3d30d8f65c321d79fbea0e53921..22f66f175ebe143d0dec1eec289e3efb8892cf8e 100644
--- a/chrome/browser/permissions/permission_context_base.h
+++ b/chrome/browser/permissions/permission_context_base.h
@@ -56,6 +56,12 @@ class PermissionContextBase : public KeyedService {
const ContentSettingsType permission_type);
~PermissionContextBase() override;
+ // A field trial used to enable the global permissions kill switch.
+ static const char kPermissionsKillSwitchFieldStudy[];
Bernhard Bauer 2015/10/21 10:29:03 Explain that this is public for testing?
mlamouri (slow - plz ping) 2015/10/21 11:26:06 Maybe this could move to permission_util?
kcarattini 2015/10/26 00:30:59 Added comment about testing. See my comment about
+
+ // The field trial param to enable the global permissions kill switch.
+ static const char kPermissionsKillSwitchBlockedValue[];
+
// The renderer is requesting permission to push messages.
// When the answer to a permission request has been determined, |callback|
// should be called with the result.
@@ -79,6 +85,11 @@ class PermissionContextBase : public KeyedService {
virtual void CancelPermissionRequest(content::WebContents* web_contents,
const PermissionRequestID& id);
+ // Whether the kill switch has been enabled for this permission.
+ // public for permissions that do not use RequestPermission, like
+ // camera and microphone, and for testing.
Bernhard Bauer 2015/10/21 10:29:03 It's a bit weird to put this into PermissionContex
mlamouri (slow - plz ping) 2015/10/21 11:26:06 I wouldn't mind having this moved to permission_ut
kcarattini 2015/10/21 11:42:47 Camera and Mic do use PermissionContextBase, they
kcarattini 2015/10/26 00:30:59 I can see the reasoning for putting this in Permis
+ bool IsPermissionKillSwitchOn() const;
+
protected:
// Decide whether the permission should be granted.
// Calls PermissionDecided if permission can be decided non-interactively,

Powered by Google App Engine
This is Rietveld 408576698