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

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

Issue 1803973002: Content Settings: Add RevocationObserver to measure when permissions are revoked (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 4 years, 8 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_uma_util.cc ('k') | chrome/browser/permissions/permission_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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..dcc9095c4b7eb51c73ab694fd76d961d4d93e23b 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.
+ // 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 void 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);
};
« no previous file with comments | « chrome/browser/permissions/permission_uma_util.cc ('k') | chrome/browser/permissions/permission_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698