OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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 "modules/accessibility/InspectorTypeBuilderHelper.h" | 5 #include "modules/accessibility/InspectorTypeBuilderHelper.h" |
6 | 6 |
7 #include "core/dom/DOMNodeIds.h" | 7 #include "core/dom/DOMNodeIds.h" |
8 #include "modules/accessibility/AXObject.h" | 8 #include "modules/accessibility/AXObject.h" |
9 #include "modules/accessibility/AXObjectCacheImpl.h" | 9 #include "modules/accessibility/AXObjectCacheImpl.h" |
10 | 10 |
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
65 ignoredReasonName(reason.reason), | 65 ignoredReasonName(reason.reason), |
66 createRelatedNodeListValue(*(reason.relatedObject), nullptr, | 66 createRelatedNodeListValue(*(reason.relatedObject), nullptr, |
67 AXValueTypeEnum::Idref)); | 67 AXValueTypeEnum::Idref)); |
68 return createProperty(ignoredReasonName(reason.reason), | 68 return createProperty(ignoredReasonName(reason.reason), |
69 createBooleanValue(true)); | 69 createBooleanValue(true)); |
70 } | 70 } |
71 | 71 |
72 std::unique_ptr<AXValue> createValue(const String& value, const String& type) { | 72 std::unique_ptr<AXValue> createValue(const String& value, const String& type) { |
73 return AXValue::create() | 73 return AXValue::create() |
74 .setType(type) | 74 .setType(type) |
75 .setValue(protocol::ValueConversions<String>::serialize(value)) | 75 .setValue(protocol::ValueConversions<String>::toValue(value)) |
76 .build(); | 76 .build(); |
77 } | 77 } |
78 | 78 |
79 std::unique_ptr<AXValue> createValue(int value, const String& type) { | 79 std::unique_ptr<AXValue> createValue(int value, const String& type) { |
80 return AXValue::create() | 80 return AXValue::create() |
81 .setType(type) | 81 .setType(type) |
82 .setValue(protocol::ValueConversions<int>::serialize(value)) | 82 .setValue(protocol::ValueConversions<int>::toValue(value)) |
83 .build(); | 83 .build(); |
84 } | 84 } |
85 | 85 |
86 std::unique_ptr<AXValue> createValue(float value, const String& type) { | 86 std::unique_ptr<AXValue> createValue(float value, const String& type) { |
87 return AXValue::create() | 87 return AXValue::create() |
88 .setType(type) | 88 .setType(type) |
89 .setValue(protocol::ValueConversions<double>::serialize(value)) | 89 .setValue(protocol::ValueConversions<double>::toValue(value)) |
90 .build(); | 90 .build(); |
91 } | 91 } |
92 | 92 |
93 std::unique_ptr<AXValue> createBooleanValue(bool value, const String& type) { | 93 std::unique_ptr<AXValue> createBooleanValue(bool value, const String& type) { |
94 return AXValue::create() | 94 return AXValue::create() |
95 .setType(type) | 95 .setType(type) |
96 .setValue(protocol::ValueConversions<bool>::serialize(value)) | 96 .setValue(protocol::ValueConversions<bool>::toValue(value)) |
97 .build(); | 97 .build(); |
98 } | 98 } |
99 | 99 |
100 std::unique_ptr<AXRelatedNode> relatedNodeForAXObject(const AXObject& axObject, | 100 std::unique_ptr<AXRelatedNode> relatedNodeForAXObject(const AXObject& axObject, |
101 String* name = nullptr) { | 101 String* name = nullptr) { |
102 Node* node = axObject.getNode(); | 102 Node* node = axObject.getNode(); |
103 if (!node) | 103 if (!node) |
104 return nullptr; | 104 return nullptr; |
105 int backendNodeId = DOMNodeIds::idForNode(node); | 105 int backendNodeId = DOMNodeIds::idForNode(node); |
106 if (!backendNodeId) | 106 if (!backendNodeId) |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
234 if (nameSource.superseded) | 234 if (nameSource.superseded) |
235 valueSource->setSuperseded(true); | 235 valueSource->setSuperseded(true); |
236 if (nameSource.invalid) | 236 if (nameSource.invalid) |
237 valueSource->setInvalid(true); | 237 valueSource->setInvalid(true); |
238 if (nameSource.nativeSource != AXTextFromNativeHTMLUninitialized) | 238 if (nameSource.nativeSource != AXTextFromNativeHTMLUninitialized) |
239 valueSource->setNativeSource(nativeSourceType(nameSource.nativeSource)); | 239 valueSource->setNativeSource(nativeSourceType(nameSource.nativeSource)); |
240 return valueSource; | 240 return valueSource; |
241 } | 241 } |
242 | 242 |
243 } // namespace blink | 243 } // namespace blink |
OLD | NEW |