#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 {
if (components_.empty()) {
return true;
}
return base::Contains(components_, component);
}
#endif
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 { … }
std::unique_ptr<Condition> SourceAttributesCondition::Create(
const base::Value& value) { … }
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)
: … { … }
std::unique_ptr<Condition> DestinationAttributesCondition::Create(
const base::Value& value) { … }
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)
: … { … }
}