#include "components/security_interstitials/core/https_only_mode_enforcelist.h"
#include "base/containers/contains.h"
#include "base/json/values_util.h"
#include "base/time/clock.h"
#include "base/values.h"
#include "components/content_settings/core/common/content_settings_utils.h"
#include "components/security_interstitials/core/https_only_mode_metrics.h"
namespace {
SiteEngagementHeuristicState;
const char kEnabledKey[] = …;
const char kAdditionTimestamp[] = …;
GURL GetSecureGURLForHost(const std::string& host) { … }
}
namespace security_interstitials {
HttpsOnlyModeEnforcelist::HttpsOnlyModeEnforcelist(
HostContentSettingsMap* host_content_settings_map,
base::Clock* clock)
: … { … }
HttpsOnlyModeEnforcelist::~HttpsOnlyModeEnforcelist() = default;
void HttpsOnlyModeEnforcelist::EnforceForHost(const std::string& host,
bool is_nondefault_storage) { … }
void HttpsOnlyModeEnforcelist::UnenforceForHost(const std::string& host,
bool is_nondefault_storage) { … }
bool HttpsOnlyModeEnforcelist::IsEnforcedForUrl(
const GURL& url,
bool is_nondefault_storage) const { … }
std::set<GURL> HttpsOnlyModeEnforcelist::GetHosts(
bool is_nondefault_storage) const { … }
void HttpsOnlyModeEnforcelist::RevokeEnforcements(const std::string& host) { … }
void HttpsOnlyModeEnforcelist::Clear(
base::Time delete_begin,
base::Time delete_end,
const HostContentSettingsMap::PatternSourcePredicate& pattern_filter) { … }
void HttpsOnlyModeEnforcelist::ClearEnforcements(base::Time delete_begin,
base::Time delete_end) { … }
void HttpsOnlyModeEnforcelist::RecordMetrics(bool is_nondefault_storage) { … }
void HttpsOnlyModeEnforcelist::SetClockForTesting(base::Clock* clock) { … }
}