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

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

Issue 2468803002: [DevTools] migrate InspectorDOMAgent to new style (Closed)
Patch Set: addressed comments and rebased Created 4 years, 1 month 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 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 "modules/accessibility/InspectorAccessibilityAgent.h" 5 #include "modules/accessibility/InspectorAccessibilityAgent.h"
6 6
7 #include "core/HTMLNames.h" 7 #include "core/HTMLNames.h"
8 #include "core/dom/AXObjectCache.h" 8 #include "core/dom/AXObjectCache.h"
9 #include "core/dom/DOMNodeIds.h" 9 #include "core/dom/DOMNodeIds.h"
10 #include "core/dom/Element.h" 10 #include "core/dom/Element.h"
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 382
383 void InspectorAccessibilityAgent::getAXNodeChain( 383 void InspectorAccessibilityAgent::getAXNodeChain(
384 ErrorString* errorString, 384 ErrorString* errorString,
385 int domNodeId, 385 int domNodeId,
386 bool fetchAncestors, 386 bool fetchAncestors,
387 std::unique_ptr<protocol::Array<protocol::Accessibility::AXNode>>* nodes) { 387 std::unique_ptr<protocol::Array<protocol::Accessibility::AXNode>>* nodes) {
388 if (!m_domAgent->enabled()) { 388 if (!m_domAgent->enabled()) {
389 *errorString = "DOM agent must be enabled"; 389 *errorString = "DOM agent must be enabled";
390 return; 390 return;
391 } 391 }
392 Node* domNode = m_domAgent->assertNode(errorString, domNodeId); 392 Node* domNode = nullptr;
393 if (!domNode) 393 Response response = m_domAgent->assertNode(domNodeId, domNode);
394 if (!response.isSuccess()) {
395 *errorString = response.errorMessage();
394 return; 396 return;
397 }
395 398
396 Document& document = domNode->document(); 399 Document& document = domNode->document();
397 document.updateStyleAndLayoutIgnorePendingStylesheets(); 400 document.updateStyleAndLayoutIgnorePendingStylesheets();
398 DocumentLifecycle::DisallowTransitionScope disallowTransition( 401 DocumentLifecycle::DisallowTransitionScope disallowTransition(
399 document.lifecycle()); 402 document.lifecycle());
400 LocalFrame* localFrame = document.frame(); 403 LocalFrame* localFrame = document.frame();
401 if (!localFrame) { 404 if (!localFrame) {
402 *errorString = "Frame is detached."; 405 *errorString = "Frame is detached.";
403 return; 406 return;
404 } 407 }
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 } 527 }
525 } 528 }
526 529
527 DEFINE_TRACE(InspectorAccessibilityAgent) { 530 DEFINE_TRACE(InspectorAccessibilityAgent) {
528 visitor->trace(m_page); 531 visitor->trace(m_page);
529 visitor->trace(m_domAgent); 532 visitor->trace(m_domAgent);
530 InspectorBaseAgent::trace(visitor); 533 InspectorBaseAgent::trace(visitor);
531 } 534 }
532 535
533 } // namespace blink 536 } // namespace blink
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/inspector/LayoutEditor.cpp ('k') | third_party/inspector_protocol/CodeGenerator.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698