| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 62 |
| 63 std::unique_ptr<AXProperty> createProperty(IgnoredReason reason) | 63 std::unique_ptr<AXProperty> createProperty(IgnoredReason reason) |
| 64 { | 64 { |
| 65 if (reason.relatedObject) | 65 if (reason.relatedObject) |
| 66 return createProperty(ignoredReasonName(reason.reason), createRelatedNod
eListValue(reason.relatedObject, nullptr, AXValueTypeEnum::Idref)); | 66 return createProperty(ignoredReasonName(reason.reason), createRelatedNod
eListValue(reason.relatedObject, nullptr, AXValueTypeEnum::Idref)); |
| 67 return createProperty(ignoredReasonName(reason.reason), createBooleanValue(t
rue)); | 67 return createProperty(ignoredReasonName(reason.reason), createBooleanValue(t
rue)); |
| 68 } | 68 } |
| 69 | 69 |
| 70 std::unique_ptr<AXValue> createValue(const String& value, const String& type) | 70 std::unique_ptr<AXValue> createValue(const String& value, const String& type) |
| 71 { | 71 { |
| 72 return AXValue::create().setType(type).setValue(protocol::toValue(value)).bu
ild(); | 72 return AXValue::create().setType(type).setValue(protocol::ValueConversions<S
tring>::serialize(value)).build(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 std::unique_ptr<AXValue> createValue(int value, const String& type) | 75 std::unique_ptr<AXValue> createValue(int value, const String& type) |
| 76 { | 76 { |
| 77 return AXValue::create().setType(type).setValue(protocol::toValue(value)).bu
ild(); | 77 return AXValue::create().setType(type).setValue(protocol::ValueConversions<i
nt>::serialize(value)).build(); |
| 78 } | 78 } |
| 79 | 79 |
| 80 std::unique_ptr<AXValue> createValue(float value, const String& type) | 80 std::unique_ptr<AXValue> createValue(float value, const String& type) |
| 81 { | 81 { |
| 82 return AXValue::create().setType(type).setValue(protocol::toValue(value)).bu
ild(); | 82 return AXValue::create().setType(type).setValue(protocol::ValueConversions<d
ouble>::serialize(value)).build(); |
| 83 } | 83 } |
| 84 | 84 |
| 85 std::unique_ptr<AXValue> createBooleanValue(bool value, const String& type) | 85 std::unique_ptr<AXValue> createBooleanValue(bool value, const String& type) |
| 86 { | 86 { |
| 87 return AXValue::create().setType(type).setValue(protocol::toValue(value)).bu
ild(); | 87 return AXValue::create().setType(type).setValue(protocol::ValueConversions<b
ool>::serialize(value)).build(); |
| 88 } | 88 } |
| 89 | 89 |
| 90 std::unique_ptr<AXRelatedNode> relatedNodeForAXObject(const AXObject* axObject,
String* name = nullptr) | 90 std::unique_ptr<AXRelatedNode> relatedNodeForAXObject(const AXObject* axObject,
String* name = nullptr) |
| 91 { | 91 { |
| 92 Node* node = axObject->getNode(); | 92 Node* node = axObject->getNode(); |
| 93 if (!node) | 93 if (!node) |
| 94 return nullptr; | 94 return nullptr; |
| 95 int backendNodeId = DOMNodeIds::idForNode(node); | 95 int backendNodeId = DOMNodeIds::idForNode(node); |
| 96 if (!backendNodeId) | 96 if (!backendNodeId) |
| 97 return nullptr; | 97 return nullptr; |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 202 if (nameSource.superseded) | 202 if (nameSource.superseded) |
| 203 valueSource->setSuperseded(true); | 203 valueSource->setSuperseded(true); |
| 204 if (nameSource.invalid) | 204 if (nameSource.invalid) |
| 205 valueSource->setInvalid(true); | 205 valueSource->setInvalid(true); |
| 206 if (nameSource.nativeSource != AXTextFromNativeHTMLUninitialized) | 206 if (nameSource.nativeSource != AXTextFromNativeHTMLUninitialized) |
| 207 valueSource->setNativeSource(nativeSourceType(nameSource.nativeSource)); | 207 valueSource->setNativeSource(nativeSourceType(nameSource.nativeSource)); |
| 208 return valueSource; | 208 return valueSource; |
| 209 } | 209 } |
| 210 | 210 |
| 211 } // namespace blink | 211 } // namespace blink |
| OLD | NEW |