OLD | NEW |
---|---|
(Empty) | |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | |
2 // Use of this source code is governed by a BSD-style license that can be | |
3 // found in the LICENSE file. | |
4 | |
5 #include "ui/accessibility/ax_node_data.h" | |
6 | |
7 #include <set> | |
8 | |
9 #include "base/containers/hash_tables.h" | |
10 #include "base/strings/string_number_conversions.h" | |
11 #include "base/strings/string_util.h" | |
12 #include "base/strings/utf_string_conversions.h" | |
13 | |
14 using base::DoubleToString; | |
15 using base::IntToString; | |
16 | |
17 namespace ui { | |
18 | |
19 AXNodeData::AXNodeData() | |
20 : id(-1), | |
21 role(AX_ROLE_UNKNOWN), | |
22 state(-1) { | |
David Tseng
2013/11/15 18:05:31
What does it mean to have state of -1?
dmazzoni
2013/11/18 08:09:25
Since it's a bitmask, it means everything is on -
| |
23 } | |
24 | |
25 AXNodeData::~AXNodeData() { | |
26 } | |
27 | |
28 void AXNodeData::AddStringAttribute( | |
29 StringAttribute attribute, const std::string& value) { | |
30 string_attributes.push_back(std::make_pair(attribute, value)); | |
31 } | |
32 | |
33 void AXNodeData::AddIntAttribute( | |
34 IntAttribute attribute, int value) { | |
35 int_attributes.push_back(std::make_pair(attribute, value)); | |
36 } | |
37 | |
38 void AXNodeData::AddFloatAttribute( | |
39 FloatAttribute attribute, float value) { | |
40 float_attributes.push_back(std::make_pair(attribute, value)); | |
41 } | |
42 | |
43 void AXNodeData::AddBoolAttribute( | |
44 BoolAttribute attribute, bool value) { | |
45 bool_attributes.push_back(std::make_pair(attribute, value)); | |
46 } | |
47 | |
48 void AXNodeData::AddIntListAttribute( | |
49 IntListAttribute attribute, const std::vector<int32>& value) { | |
50 intlist_attributes.push_back(std::make_pair(attribute, value)); | |
51 } | |
52 | |
53 void AXNodeData::SetName(std::string name) { | |
54 string_attributes.push_back(std::make_pair(ATTR_NAME, name)); | |
55 } | |
56 | |
57 void AXNodeData::SetValue(std::string value) { | |
58 string_attributes.push_back(std::make_pair(ATTR_VALUE, value)); | |
59 } | |
60 | |
61 } // namespace ui | |
OLD | NEW |