#include "components/subresource_filter/content/browser/ads_intervention_manager.h"
#include <optional>
#include "base/metrics/histogram_macros.h"
#include "base/time/default_clock.h"
#include "base/time/time.h"
#include "base/values.h"
#include "components/subresource_filter/content/browser/subresource_filter_content_settings_manager.h"
#include "components/subresource_filter/core/browser/subresource_filter_features.h"
#include "content/public/browser/navigation_handle.h"
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "url/gurl.h"
namespace subresource_filter {
namespace {
const char kLastAdsViolationTimeKey[] = …;
const char kLastAdsViolationKey[] = …;
const char kAdsInterventionRecordedHistogramName[] = …;
AdsInterventionStatus GetAdsInterventionStatus(bool activation_status,
bool intervention_active) { … }
}
base::TimeDelta AdsInterventionManager::GetInterventionDuration(
mojom::AdsViolation violation) { … }
AdsInterventionManager::AdsInterventionManager(
SubresourceFilterContentSettingsManager* settings_manager)
: … { … }
AdsInterventionManager::~AdsInterventionManager() = default;
void AdsInterventionManager::TriggerAdsInterventionForUrlOnSubsequentLoads(
const GURL& url,
mojom::AdsViolation ads_violation) { … }
std::optional<AdsInterventionManager::LastAdsIntervention>
AdsInterventionManager::GetLastAdsIntervention(const GURL& url) const { … }
bool AdsInterventionManager::ShouldActivate(
content::NavigationHandle* navigation_handle) const { … }
}