Index: chrome/browser/permissions/permission_util.h |
diff --git a/chrome/browser/permissions/permission_util.h b/chrome/browser/permissions/permission_util.h |
index eb0e066f2484c2825e7ed059fe9ebcb7ac7df00f..b23bea17e0632a2ac03393cd9f53d96904ff4ec4 100644 |
--- a/chrome/browser/permissions/permission_util.h |
+++ b/chrome/browser/permissions/permission_util.h |
@@ -8,8 +8,12 @@ |
#include <string> |
#include "base/macros.h" |
+#include "components/content_settings/core/common/content_settings.h" |
#include "components/content_settings/core/common/content_settings_types.h" |
+class GURL; |
+class Profile; |
+ |
namespace content { |
enum class PermissionType; |
} // namespace content |
@@ -29,6 +33,23 @@ class PermissionUtil { |
static bool GetPermissionType(ContentSettingsType type, |
content::PermissionType* out); |
+ // Helper method which proxies |
+ // HostContentSettingsMap::SetContentSettingDefaultScope(). Checks the content |
+ // setting value before and after the change to determine whether it has gone |
+ // from ALLOW to BLOCK or ASK, and records metrics accordingly. Should be |
+ // called from UI code when a user changes permissions for a particular origin |
+ // pair. Returns true if the permission was revoked. |
+ // TODO(tsergeant): This is a temporary solution to begin gathering metrics. |
+ // We should integrate this better with the permissions layer. See |
+ // crbug.com/469221. |
+ static bool SetContentSettingRecordRevocation( |
Bernhard Bauer
2016/03/22 10:13:29
Nit: SetContentSetting*And*RecordRevocation maybe?
tsergeant
2016/03/22 23:55:20
Done.
|
+ Profile* profile, |
+ const GURL& primary_url, |
+ const GURL& secondary_url, |
+ ContentSettingsType content_type, |
+ std::string resource_identifier, |
+ ContentSetting setting); |
+ |
private: |
DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); |
}; |