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 "content/public/common/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 { | |
18 | |
19 #ifndef NDEBUG | |
20 std::string IntVectorToString(const std::vector<int>& items) { | |
aboxhall
2013/11/11 18:20:35
Is this used, given all the debugging logic was re
dmazzoni
2013/11/12 00:03:04
Done.
| |
21 std::string str; | |
22 for (size_t i = 0; i < items.size(); ++i) { | |
23 if (i > 0) | |
24 str += ","; | |
25 str += IntToString(items[i]); | |
26 } | |
27 return str; | |
28 } | |
29 #endif | |
30 | |
31 } // Anonymous namespace | |
32 | |
33 namespace content { | |
34 | |
35 AXNodeData::AXNodeData() | |
36 : id(-1), | |
37 role(WebKit::WebAXRoleUnknown), | |
38 state(-1) { | |
39 } | |
40 | |
41 AXNodeData::~AXNodeData() { | |
42 } | |
43 | |
44 void AXNodeData::AddStringAttribute( | |
45 StringAttribute attribute, const std::string& value) { | |
46 string_attributes.push_back(std::make_pair(attribute, value)); | |
47 } | |
48 | |
49 void AXNodeData::AddIntAttribute( | |
50 IntAttribute attribute, int value) { | |
51 int_attributes.push_back(std::make_pair(attribute, value)); | |
52 } | |
53 | |
54 void AXNodeData::AddFloatAttribute( | |
55 FloatAttribute attribute, float value) { | |
56 float_attributes.push_back(std::make_pair(attribute, value)); | |
57 } | |
58 | |
59 void AXNodeData::AddBoolAttribute( | |
60 BoolAttribute attribute, bool value) { | |
61 bool_attributes.push_back(std::make_pair(attribute, value)); | |
62 } | |
63 | |
64 void AXNodeData::AddIntListAttribute( | |
65 IntListAttribute attribute, const std::vector<int32>& value) { | |
66 intlist_attributes.push_back(std::make_pair(attribute, value)); | |
67 } | |
68 | |
69 void AXNodeData::SetName(std::string name) { | |
70 string_attributes.push_back(std::make_pair(ATTR_NAME, name)); | |
71 } | |
72 | |
73 void AXNodeData::SetValue(std::string value) { | |
74 string_attributes.push_back(std::make_pair(ATTR_VALUE, value)); | |
75 } | |
76 | |
77 } // namespace content | |
OLD | NEW |