#include "chrome/browser/enterprise/data_controls/chrome_dlp_rules_manager.h"
#include "base/feature_list.h"
#include "base/notreached.h"
#include "chrome/browser/profiles/profile.h"
#include "components/enterprise/data_controls/core/browser/features.h"
#include "components/enterprise/data_controls/core/browser/prefs.h"
#include "components/prefs/pref_service.h"
#include "url/origin.h"
namespace data_controls {
namespace {
Level;
RuleId;
UrlConditionId;
RulesConditionsMap;
constexpr char kWildCardMatching[] = …;
}
ChromeDlpRulesManager::ChromeDlpRulesManager(Profile* profile)
: … { … }
ChromeDlpRulesManager::~ChromeDlpRulesManager() = default;
Level ChromeDlpRulesManager::IsRestricted(const GURL& source,
Restriction restriction) const { … }
Level ChromeDlpRulesManager::IsRestrictedByAnyRule(
const GURL& source,
Restriction restriction,
std::string* out_source_pattern,
RuleMetadata* out_rule_metadata) const { … }
Level ChromeDlpRulesManager::IsRestrictedDestination(
const GURL& source,
const GURL& destination,
Restriction restriction,
std::string* out_source_pattern,
std::string* out_destination_pattern,
RuleMetadata* out_rule_metadata) const { … }
DlpRulesManagerBase::AggregatedDestinations
ChromeDlpRulesManager::GetAggregatedDestinations(
const GURL& source,
Restriction restriction) const { … }
std::string ChromeDlpRulesManager::GetSourceUrlPattern(
const GURL& source_url,
Restriction restriction,
Level level,
RuleMetadata* out_rule_metadata) const { … }
RulesConditionsMap ChromeDlpRulesManager::MatchUrlAndGetRulesMapping(
const GURL& url,
const url_matcher::URLMatcher* url_matcher,
const std::map<UrlConditionId, RuleId>& rules_map) { … }
template <typename T>
ChromeDlpRulesManager::MatchedRuleInfo<T>
ChromeDlpRulesManager::GetMaxJoinRestrictionLevelAndRuleId(
const Restriction restriction,
const std::map<RuleId, T>& selected_rules,
const std::map<Restriction, std::map<RuleId, Level>>& restrictions_map,
const bool ignore_allow) const { … }
void ChromeDlpRulesManager::OnDataLeakPreventionRulesUpdate() { … }
}