#include "chrome/browser/permissions/permission_revocation_request.h"
#include "base/task/sequenced_task_runner.h"
#include "base/time/default_clock.h"
#include "chrome/browser/browser_process.h"
#include "chrome/browser/content_settings/host_content_settings_map_factory.h"
#include "chrome/browser/permissions/notifications_permission_revocation_config.h"
#include "chrome/browser/permissions/permission_manager_factory.h"
#include "chrome/browser/safe_browsing/safe_browsing_service.h"
#include "components/content_settings/core/browser/host_content_settings_map.h"
#include "components/permissions/constants.h"
#include "components/permissions/permission_manager.h"
#include "components/permissions/permission_uma_util.h"
#include "components/permissions/permissions_client.h"
#include "components/prefs/pref_service.h"
#include "components/safe_browsing/core/browser/db/database_manager.h"
#include "components/safe_browsing/core/common/safe_browsing_prefs.h"
namespace {
constexpr char kExcludedKey[] = …;
constexpr char kPermissionName[] = …;
struct OriginStatus { … };
OriginStatus GetOriginStatus(Profile* profile, const GURL& origin) { … }
void SetOriginStatus(Profile* profile,
const GURL& origin,
const OriginStatus& status) { … }
void RevokePermission(const GURL& origin, Profile* profile) { … }
}
PermissionRevocationRequest::PermissionRevocationRequest(
Profile* profile,
const GURL& origin,
OutcomeCallback callback)
: … { … }
PermissionRevocationRequest::~PermissionRevocationRequest() = default;
void PermissionRevocationRequest::ExemptOriginFromFutureRevocations(
Profile* profile,
const GURL& origin) { … }
bool PermissionRevocationRequest::IsOriginExemptedFromFutureRevocations(
Profile* profile,
const GURL& origin) { … }
bool PermissionRevocationRequest::HasPreviouslyRevokedPermission(
Profile* profile,
const GURL& origin) { … }
void PermissionRevocationRequest::CheckAndRevokeIfBlocklisted() { … }
void PermissionRevocationRequest::OnSiteReputationReady(
const CrowdDenyPreloadData::SiteReputation* site_reputation) { … }
void PermissionRevocationRequest::OnSafeBrowsingVerdictReceived(
const CrowdDenyPreloadData::SiteReputation* site_reputation,
CrowdDenySafeBrowsingRequest::Verdict verdict) { … }
void PermissionRevocationRequest::NotifyCallback(Outcome outcome) { … }