| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "ui/accessibility/ax_node_data.h" | 5 #include "ui/accessibility/ax_node_data.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 226 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 237 void AXNodeData::AddBoolAttribute( | 237 void AXNodeData::AddBoolAttribute( |
| 238 AXBoolAttribute attribute, bool value) { | 238 AXBoolAttribute attribute, bool value) { |
| 239 bool_attributes.push_back(std::make_pair(attribute, value)); | 239 bool_attributes.push_back(std::make_pair(attribute, value)); |
| 240 } | 240 } |
| 241 | 241 |
| 242 void AXNodeData::AddIntListAttribute( | 242 void AXNodeData::AddIntListAttribute( |
| 243 AXIntListAttribute attribute, const std::vector<int32>& value) { | 243 AXIntListAttribute attribute, const std::vector<int32>& value) { |
| 244 intlist_attributes.push_back(std::make_pair(attribute, value)); | 244 intlist_attributes.push_back(std::make_pair(attribute, value)); |
| 245 } | 245 } |
| 246 | 246 |
| 247 void AXNodeData::SetName(std::string name) { | 247 void AXNodeData::SetName(const std::string& name) { |
| 248 string_attributes.push_back(std::make_pair(AX_ATTR_NAME, name)); | 248 string_attributes.push_back(std::make_pair(AX_ATTR_NAME, name)); |
| 249 } | 249 } |
| 250 | 250 |
| 251 void AXNodeData::SetValue(std::string value) { | 251 void AXNodeData::SetValue(const std::string& value) { |
| 252 string_attributes.push_back(std::make_pair(AX_ATTR_VALUE, value)); | 252 string_attributes.push_back(std::make_pair(AX_ATTR_VALUE, value)); |
| 253 } | 253 } |
| 254 | 254 |
| 255 std::string AXNodeData::ToString() const { | 255 std::string AXNodeData::ToString() const { |
| 256 std::string result; | 256 std::string result; |
| 257 | 257 |
| 258 result += "id=" + IntToString(id); | 258 result += "id=" + IntToString(id); |
| 259 result += " " + ui::ToString(role); | 259 result += " " + ui::ToString(role); |
| 260 | 260 |
| 261 if (state & (1 << AX_STATE_BUSY)) | 261 if (state & (1 << AX_STATE_BUSY)) |
| (...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 676 bool AXNodeData::IsRoot() const { | 676 bool AXNodeData::IsRoot() const { |
| 677 return (role == AX_ROLE_ROOT_WEB_AREA || | 677 return (role == AX_ROLE_ROOT_WEB_AREA || |
| 678 role == AX_ROLE_DESKTOP); | 678 role == AX_ROLE_DESKTOP); |
| 679 } | 679 } |
| 680 | 680 |
| 681 void AXNodeData::SetRoot() { | 681 void AXNodeData::SetRoot() { |
| 682 role = AX_ROLE_ROOT_WEB_AREA; | 682 role = AX_ROLE_ROOT_WEB_AREA; |
| 683 } | 683 } |
| 684 | 684 |
| 685 } // namespace ui | 685 } // namespace ui |
| OLD | NEW |