| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "config.h" | 5 #include "config.h" |
| 6 | 6 |
| 7 #include "modules/accessibility/InspectorAccessibilityAgent.h" | 7 #include "modules/accessibility/InspectorAccessibilityAgent.h" |
| 8 | 8 |
| 9 #include "core/dom/AXObjectCache.h" | 9 #include "core/dom/AXObjectCache.h" |
| 10 #include "core/dom/DOMNodeIds.h" | 10 #include "core/dom/DOMNodeIds.h" |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 418 | 418 |
| 419 InspectorDOMAgent* domAgent = toLocalFrame(mainFrame)->instrumentingAgents()
->inspectorDOMAgent(); | 419 InspectorDOMAgent* domAgent = toLocalFrame(mainFrame)->instrumentingAgents()
->inspectorDOMAgent(); |
| 420 if (!domAgent) { | 420 if (!domAgent) { |
| 421 *errorString = "DOM agent must be enabled"; | 421 *errorString = "DOM agent must be enabled"; |
| 422 return; | 422 return; |
| 423 } | 423 } |
| 424 Node* node = domAgent->assertNode(errorString, nodeId); | 424 Node* node = domAgent->assertNode(errorString, nodeId); |
| 425 if (!node) | 425 if (!node) |
| 426 return; | 426 return; |
| 427 Document& document = node->document(); | 427 Document& document = node->document(); |
| 428 ScopedAXObjectCache cache(document); | 428 RefPtr<ScopedAXObjectCache> cache(adoptRef(new ScopedAXObjectCache(document)
)); |
| 429 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache.get()); | 429 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get()); |
| 430 AXObject* axObject = cacheImpl->getOrCreate(node); | 430 AXObject* axObject = cacheImpl->getOrCreate(node); |
| 431 if (!axObject) | 431 if (!axObject) |
| 432 return; | 432 return; |
| 433 | 433 |
| 434 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro
perty>::create(); | 434 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro
perty>::create(); |
| 435 fillLiveRegionProperties(axObject, properties); | 435 fillLiveRegionProperties(axObject, properties); |
| 436 fillGlobalStates(axObject, properties); | 436 fillGlobalStates(axObject, properties); |
| 437 fillWidgetProperties(axObject, properties); | 437 fillWidgetProperties(axObject, properties); |
| 438 fillWidgetStates(axObject, properties); | 438 fillWidgetStates(axObject, properties); |
| 439 fillRelationships(axObject, properties); | 439 fillRelationships(axObject, properties); |
| 440 | 440 |
| 441 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties
); | 441 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties
); |
| 442 } | 442 } |
| 443 | 443 |
| 444 DEFINE_TRACE(InspectorAccessibilityAgent) | 444 DEFINE_TRACE(InspectorAccessibilityAgent) |
| 445 { | 445 { |
| 446 visitor->trace(m_page); | 446 visitor->trace(m_page); |
| 447 InspectorBaseAgent::trace(visitor); | 447 InspectorBaseAgent::trace(visitor); |
| 448 } | 448 } |
| 449 | 449 |
| 450 } // namespace blink | 450 } // namespace blink |
| OLD | NEW |