Chromium Code Reviews| 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..b4f86ea93658921f9995d29478f33b9957ae8611 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. |
|
felt
2016/04/04 13:20:27
Seems a little weird to have this return a boolean
tsergeant
2016/04/04 23:48:28
Yeah, it was only used for testing. I've removed i
|
| + static bool SetContentSettingAndRecordRevocation( |
| + Profile* profile, |
| + const GURL& primary_url, |
| + const GURL& secondary_url, |
| + ContentSettingsType content_type, |
| + std::string resource_identifier, |
| + ContentSetting setting); |
| + |
| private: |
| DISALLOW_IMPLICIT_CONSTRUCTORS(PermissionUtil); |
| }; |