chromium/components/enterprise/data_controls/core/browser/conditions/attributes_condition.cc

// Copyright 2023 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/enterprise/data_controls/core/browser/conditions/attributes_condition.h"

#include <algorithm>

#include "base/containers/contains.h"
#include "base/memory/ptr_util.h"
#include "components/url_matcher/url_util.h"

namespace data_controls {

AttributesCondition::~AttributesCondition() = default;

AttributesCondition::AttributesCondition(const base::Value::Dict& value) {}

AttributesCondition::AttributesCondition(AttributesCondition&& other) = default;

bool AttributesCondition::IsValid() const {}

bool AttributesCondition::URLMatches(GURL url) const {}

#if BUILDFLAG(IS_CHROMEOS)
bool AttributesCondition::ComponentMatches(Component component) const {
  // Without components to match, any URL is considered to pass the condition.
  if (components_.empty()) {
    return true;
  }

  // With components to match, `component` needs to be in the set to pass the
  // condition.
  return base::Contains(components_, component);
}
#endif  // BUILDFLAG(IS_CHROMEOS)

bool AttributesCondition::IncognitoMatches(bool incognito) const {}

bool AttributesCondition::OsClipboardMatches(bool os_clipboard) const {}

bool AttributesCondition::OtherProfileMatches(bool other_profile) const {}

bool AttributesCondition::is_os_clipboard_condition() const {}

// static
std::unique_ptr<Condition> SourceAttributesCondition::Create(
    const base::Value& value) {}

// static
std::unique_ptr<Condition> SourceAttributesCondition::Create(
    const base::Value::Dict& value) {}

bool SourceAttributesCondition::CanBeEvaluated(
    const ActionContext& action_context) const {}

bool SourceAttributesCondition::IsTriggered(
    const ActionContext& action_context) const {}

SourceAttributesCondition::SourceAttributesCondition(
    AttributesCondition&& attributes_condition)
    :{}

// static
std::unique_ptr<Condition> DestinationAttributesCondition::Create(
    const base::Value& value) {}

// static
std::unique_ptr<Condition> DestinationAttributesCondition::Create(
    const base::Value::Dict& value) {}

bool DestinationAttributesCondition::CanBeEvaluated(
    const ActionContext& action_context) const {}

bool DestinationAttributesCondition::IsTriggered(
    const ActionContext& action_context) const {}

DestinationAttributesCondition::DestinationAttributesCondition(
    AttributesCondition&& attributes_condition)
    :{}

}  // namespace data_controls