#include "components/lookalikes/core/safety_tips_config.h"
#include "base/no_destructor.h"
#include "base/ranges/algorithm.h"
#include "components/safe_browsing/core/browser/db/v4_protocol_manager_util.h"
#include "third_party/re2/src/re2/re2.h"
#include "url/gurl.h"
V4ProtocolManagerUtil;
namespace lookalikes {
namespace {
class SafetyTipsConfigSingleton { … };
void UrlToSafetyTipPatterns(const GURL& url,
std::vector<std::string>* patterns) { … }
bool IsUrlAllowedByCohort(const reputation::SafetyTipsConfig* proto,
const GURL& canonical_url,
unsigned cohort_index) { … }
}
void SetSafetyTipsRemoteConfigProto(
std::unique_ptr<reputation::SafetyTipsConfig> proto) { … }
const reputation::SafetyTipsConfig* GetSafetyTipsRemoteConfigProto() { … }
bool IsUrlAllowlistedBySafetyTipsComponent(
const reputation::SafetyTipsConfig* proto,
const GURL& visited_url,
const GURL& canonical_url) { … }
bool IsTargetHostAllowlistedBySafetyTipsComponent(
const reputation::SafetyTipsConfig* proto,
const std::string& hostname) { … }
bool IsCommonWordInConfigProto(const reputation::SafetyTipsConfig* proto,
const std::string& word) { … }
}