Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(14)

Side by Side Diff: third_party/WebKit/Source/modules/accessibility/InspectorTypeBuilderHelper.cpp

Issue 2522583002: Roll third_party/inspector_protocol to 4ad35c45aca9834b67ec2cb152c816ea1b7ceb48 (Closed)
Patch Set: updated README.chromium Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/ProtocolParserTest.cpp ('k') | third_party/WebKit/Source/web/InspectorOverlay.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698