chromium/components/lookalikes/core/safety_tips_config.cc

// Copyright 2019 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#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 {};

// Given a URL, generates all possible variant URLs to check the blocklist for.
// This is conceptually almost identical to safe_browsing::UrlToFullHashes, but
// without the hashing step.
//
// Note: Blocking "a.b/c/" does NOT block http://a.b/c without the trailing /.
void UrlToSafetyTipPatterns(const GURL& url,
                            std::vector<std::string>* patterns) {}

// Return whether |canonical_url| is a member of the designated cohort.
bool IsUrlAllowedByCohort(const reputation::SafetyTipsConfig* proto,
                          const GURL& canonical_url,
                          unsigned cohort_index) {}

}  // namespace

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) {}

}  // namespace lookalikes