| 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 #include "platform/inspector_protocol/TypeBuilder.h" | 10 #include "platform/inspector_protocol/TypeBuilder.h" |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 181 } | 181 } |
| 182 | 182 |
| 183 PassOwnPtr<AXValueSource> createValueSource(NameSource& nameSource) | 183 PassOwnPtr<AXValueSource> createValueSource(NameSource& nameSource) |
| 184 { | 184 { |
| 185 String type = valueSourceType(nameSource.type); | 185 String type = valueSourceType(nameSource.type); |
| 186 OwnPtr<AXValueSource> valueSource = AXValueSource::create().setType(type).bu
ild(); | 186 OwnPtr<AXValueSource> valueSource = AXValueSource::create().setType(type).bu
ild(); |
| 187 if (!nameSource.relatedObjects.isEmpty()) { | 187 if (!nameSource.relatedObjects.isEmpty()) { |
| 188 if (nameSource.attribute == aria_labelledbyAttr || nameSource.attribute
== aria_labeledbyAttr) { | 188 if (nameSource.attribute == aria_labelledbyAttr || nameSource.attribute
== aria_labeledbyAttr) { |
| 189 OwnPtr<AXValue> attributeValue = createRelatedNodeListValue(nameSour
ce.relatedObjects, AXValueTypeEnum::IdrefList); | 189 OwnPtr<AXValue> attributeValue = createRelatedNodeListValue(nameSour
ce.relatedObjects, AXValueTypeEnum::IdrefList); |
| 190 if (!nameSource.attributeValue.isNull()) | 190 if (!nameSource.attributeValue.isNull()) |
| 191 attributeValue->setValue(JSONString::create(nameSource.attribute
Value.string()).get()); | 191 attributeValue->setValue(protocol::StringValue::create(nameSourc
e.attributeValue.string()).get()); |
| 192 valueSource->setAttributeValue(attributeValue.release()); | 192 valueSource->setAttributeValue(attributeValue.release()); |
| 193 } else if (nameSource.attribute == QualifiedName::null()) { | 193 } else if (nameSource.attribute == QualifiedName::null()) { |
| 194 valueSource->setNativeSourceValue(createRelatedNodeListValue(nameSou
rce.relatedObjects, AXValueTypeEnum::NodeList)); | 194 valueSource->setNativeSourceValue(createRelatedNodeListValue(nameSou
rce.relatedObjects, AXValueTypeEnum::NodeList)); |
| 195 } | 195 } |
| 196 } else if (!nameSource.attributeValue.isNull()) { | 196 } else if (!nameSource.attributeValue.isNull()) { |
| 197 valueSource->setAttributeValue(createValue(nameSource.attributeValue)); | 197 valueSource->setAttributeValue(createValue(nameSource.attributeValue)); |
| 198 } | 198 } |
| 199 if (!nameSource.text.isNull()) | 199 if (!nameSource.text.isNull()) |
| 200 valueSource->setValue(createValue(nameSource.text, AXValueTypeEnum::Comp
utedString)); | 200 valueSource->setValue(createValue(nameSource.text, AXValueTypeEnum::Comp
utedString)); |
| 201 if (nameSource.attribute != QualifiedName::null()) | 201 if (nameSource.attribute != QualifiedName::null()) |
| 202 valueSource->setAttribute(nameSource.attribute.localName().string()); | 202 valueSource->setAttribute(nameSource.attribute.localName().string()); |
| 203 if (nameSource.superseded) | 203 if (nameSource.superseded) |
| 204 valueSource->setSuperseded(true); | 204 valueSource->setSuperseded(true); |
| 205 if (nameSource.invalid) | 205 if (nameSource.invalid) |
| 206 valueSource->setInvalid(true); | 206 valueSource->setInvalid(true); |
| 207 if (nameSource.nativeSource != AXTextFromNativeHTMLUninitialized) | 207 if (nameSource.nativeSource != AXTextFromNativeHTMLUninitialized) |
| 208 valueSource->setNativeSource(nativeSourceType(nameSource.nativeSource)); | 208 valueSource->setNativeSource(nativeSourceType(nameSource.nativeSource)); |
| 209 return valueSource.release(); | 209 return valueSource.release(); |
| 210 } | 210 } |
| 211 | 211 |
| 212 } // namespace blink | 212 } // namespace blink |
| OLD | NEW |