OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "content/browser/accessibility/browser_accessibility_manager.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
(...skipping 673 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 } | 684 } |
685 | 685 |
686 // static | 686 // static |
687 bool BrowserAccessibilityManager::FindIndicesInCommonParent( | 687 bool BrowserAccessibilityManager::FindIndicesInCommonParent( |
688 const BrowserAccessibility& object1, | 688 const BrowserAccessibility& object1, |
689 const BrowserAccessibility& object2, | 689 const BrowserAccessibility& object2, |
690 BrowserAccessibility** common_parent, | 690 BrowserAccessibility** common_parent, |
691 int* child_index1, | 691 int* child_index1, |
692 int* child_index2) { | 692 int* child_index2) { |
693 DCHECK(common_parent && child_index1 && child_index2); | 693 DCHECK(common_parent && child_index1 && child_index2); |
694 auto ancestor1 = const_cast<BrowserAccessibility*>(&object1); | 694 auto* ancestor1 = const_cast<BrowserAccessibility*>(&object1); |
695 auto ancestor2 = const_cast<BrowserAccessibility*>(&object2); | 695 auto* ancestor2 = const_cast<BrowserAccessibility*>(&object2); |
696 do { | 696 do { |
697 *child_index1 = ancestor1->GetIndexInParent(); | 697 *child_index1 = ancestor1->GetIndexInParent(); |
698 ancestor1 = ancestor1->GetParent(); | 698 ancestor1 = ancestor1->GetParent(); |
699 } while ( | 699 } while ( |
700 ancestor1 && | 700 ancestor1 && |
701 // |BrowserAccessibility::IsAncestorOf| returns true if objects are equal. | 701 // |BrowserAccessibility::IsAncestorOf| returns true if objects are equal. |
702 (ancestor1 == ancestor2 || !ancestor2->IsDescendantOf(ancestor1))); | 702 (ancestor1 == ancestor2 || !ancestor2->IsDescendantOf(ancestor1))); |
703 | 703 |
704 if (!ancestor1) { | 704 if (!ancestor1) { |
705 *common_parent = nullptr; | 705 *common_parent = nullptr; |
(...skipping 243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
949 tree_source(tree_->CreateTreeSource()); | 949 tree_source(tree_->CreateTreeSource()); |
950 ui::AXTreeSerializer<const ui::AXNode*, | 950 ui::AXTreeSerializer<const ui::AXNode*, |
951 ui::AXNodeData, | 951 ui::AXNodeData, |
952 ui::AXTreeData> serializer(tree_source.get()); | 952 ui::AXTreeData> serializer(tree_source.get()); |
953 ui::AXTreeUpdate update; | 953 ui::AXTreeUpdate update; |
954 serializer.SerializeChanges(tree_->root(), &update); | 954 serializer.SerializeChanges(tree_->root(), &update); |
955 return update; | 955 return update; |
956 } | 956 } |
957 | 957 |
958 } // namespace content | 958 } // namespace content |
OLD | NEW |