| Index: ui/accessibility/ax_action_data.cc
|
| diff --git a/ui/accessibility/ax_action_data.cc b/ui/accessibility/ax_action_data.cc
|
| index 8b9dbbef3c6934b03b7e369d72d6eda5433f4713..50813a9d06e5bdb028060ec3507217a3eab5694f 100644
|
| --- a/ui/accessibility/ax_action_data.cc
|
| +++ b/ui/accessibility/ax_action_data.cc
|
| @@ -4,6 +4,7 @@
|
|
|
| #include "ui/accessibility/ax_action_data.h"
|
|
|
| +#include <algorithm>
|
| #include <set>
|
|
|
| #include "base/strings/string_number_conversions.h"
|
| @@ -30,6 +31,20 @@ AXActionData::AXActionData(const AXActionData& other) = default;
|
| AXActionData::~AXActionData() {
|
| }
|
|
|
| +void AXActionData::AddBoolAttribute(AXActionBoolAttribute attribute,
|
| + bool value) {
|
| + bool_attributes.push_back(std::make_pair(attribute, value));
|
| +}
|
| +
|
| +bool AXActionData::GetBoolAttribute(AXActionBoolAttribute attr) const {
|
| + auto iter =
|
| + std::find_if(bool_attributes.begin(), bool_attributes.end(),
|
| + [attr](const std::pair<AXActionBoolAttribute, bool>& item) {
|
| + return item.first == attr;
|
| + });
|
| + return iter != bool_attributes.end() && iter->second;
|
| +}
|
| +
|
| // Note that this includes an initial space character if nonempty, but
|
| // that works fine because this is normally printed by AXAction::ToString.
|
| std::string AXActionData::ToString() const {
|
|
|