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 338 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
349 InspectorDOMAgent* domAgent = toLocalFrame(mainFrame)->instrumentingAgents()
->inspectorDOMAgent(); | 349 InspectorDOMAgent* domAgent = toLocalFrame(mainFrame)->instrumentingAgents()
->inspectorDOMAgent(); |
350 if (!domAgent) { | 350 if (!domAgent) { |
351 *errorString = "DOM agent must be enabled"; | 351 *errorString = "DOM agent must be enabled"; |
352 return; | 352 return; |
353 } | 353 } |
354 Node* node = domAgent->assertNode(errorString, nodeId); | 354 Node* node = domAgent->assertNode(errorString, nodeId); |
355 if (!node) | 355 if (!node) |
356 return; | 356 return; |
357 | 357 |
358 Document& document = node->document(); | 358 Document& document = node->document(); |
359 RefPtr<ScopedAXObjectCache> cache(adoptRef(new ScopedAXObjectCache(document)
)); | 359 OwnPtr<ScopedAXObjectCache> cache = ScopedAXObjectCache::create(document); |
360 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get()); | 360 AXObjectCacheImpl* cacheImpl = toAXObjectCacheImpl(cache->get()); |
361 AXObject* axObject = cacheImpl->getOrCreate(node); | 361 AXObject* axObject = cacheImpl->getOrCreate(node); |
362 if (!axObject || axObject->accessibilityIsIgnored()) { | 362 if (!axObject || axObject->accessibilityIsIgnored()) { |
363 accessibilityNode = buildObjectForIgnoredNode(node, axObject, cacheImpl)
; | 363 accessibilityNode = buildObjectForIgnoredNode(node, axObject, cacheImpl)
; |
364 return; | 364 return; |
365 } | 365 } |
366 | 366 |
367 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro
perty>::create(); | 367 RefPtr<TypeBuilder::Array<AXProperty>> properties = TypeBuilder::Array<AXPro
perty>::create(); |
368 fillLiveRegionProperties(axObject, properties); | 368 fillLiveRegionProperties(axObject, properties); |
369 fillGlobalStates(axObject, properties); | 369 fillGlobalStates(axObject, properties); |
370 fillWidgetProperties(axObject, properties); | 370 fillWidgetProperties(axObject, properties); |
371 fillWidgetStates(axObject, properties); | 371 fillWidgetStates(axObject, properties); |
372 fillRelationships(axObject, properties); | 372 fillRelationships(axObject, properties); |
373 | 373 |
374 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties
); | 374 accessibilityNode = buildObjectForNode(node, axObject, cacheImpl, properties
); |
375 } | 375 } |
376 | 376 |
377 DEFINE_TRACE(InspectorAccessibilityAgent) | 377 DEFINE_TRACE(InspectorAccessibilityAgent) |
378 { | 378 { |
379 visitor->trace(m_page); | 379 visitor->trace(m_page); |
380 InspectorBaseAgent::trace(visitor); | 380 InspectorBaseAgent::trace(visitor); |
381 } | 381 } |
382 | 382 |
383 } // namespace blink | 383 } // namespace blink |
OLD | NEW |