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

Side by Side Diff: ui/accessibility/ax_serializable_tree.cc

Issue 1550483002: Switch to standard integer types in ui/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@int-ui-events
Patch Set: Created 4 years, 12 months 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
« no previous file with comments | « ui/accessibility/ax_node_data.cc ('k') | ui/accessibility/ax_text_utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ui/accessibility/ax_serializable_tree.h" 5 #include "ui/accessibility/ax_serializable_tree.h"
6 6
7 #include <stdint.h>
8
7 #include "ui/accessibility/ax_node.h" 9 #include "ui/accessibility/ax_node.h"
8 10
9 namespace ui { 11 namespace ui {
10 12
11 // This class is an implementation of the AXTreeSource interface with 13 // This class is an implementation of the AXTreeSource interface with
12 // AXNode as the node type, that just delegates to an AXTree. The purpose 14 // AXNode as the node type, that just delegates to an AXTree. The purpose
13 // of this is so that AXTreeSerializer only needs to work with the 15 // of this is so that AXTreeSerializer only needs to work with the
14 // AXTreeSource abstraction and doesn't need to actually know about 16 // AXTreeSource abstraction and doesn't need to actually know about
15 // AXTree directly. Another AXTreeSource is used to abstract the Blink 17 // AXTree directly. Another AXTreeSource is used to abstract the Blink
16 // accessibility tree. 18 // accessibility tree.
17 class AX_EXPORT AXTreeSourceAdapter 19 class AX_EXPORT AXTreeSourceAdapter
18 : public AXTreeSource<const AXNode*, AXNodeData, AXTreeData> { 20 : public AXTreeSource<const AXNode*, AXNodeData, AXTreeData> {
19 public: 21 public:
20 AXTreeSourceAdapter(AXTree* tree) : tree_(tree) {} 22 AXTreeSourceAdapter(AXTree* tree) : tree_(tree) {}
21 ~AXTreeSourceAdapter() override {} 23 ~AXTreeSourceAdapter() override {}
22 24
23 // AXTreeSource implementation. 25 // AXTreeSource implementation.
24 AXTreeData GetTreeData() const override { return tree_->data(); } 26 AXTreeData GetTreeData() const override { return tree_->data(); }
25 27
26 AXNode* GetRoot() const override { return tree_->root(); } 28 AXNode* GetRoot() const override { return tree_->root(); }
27 29
28 AXNode* GetFromId(int32 id) const override { return tree_->GetFromId(id); } 30 AXNode* GetFromId(int32_t id) const override { return tree_->GetFromId(id); }
29 31
30 int32 GetId(const AXNode* node) const override { return node->id(); } 32 int32_t GetId(const AXNode* node) const override { return node->id(); }
31 33
32 void GetChildren(const AXNode* node, 34 void GetChildren(const AXNode* node,
33 std::vector<const AXNode*>* out_children) const override { 35 std::vector<const AXNode*>* out_children) const override {
34 for (int i = 0; i < node->child_count(); ++i) 36 for (int i = 0; i < node->child_count(); ++i)
35 out_children->push_back(node->ChildAtIndex(i)); 37 out_children->push_back(node->ChildAtIndex(i));
36 } 38 }
37 39
38 AXNode* GetParent(const AXNode* node) const override { 40 AXNode* GetParent(const AXNode* node) const override {
39 return node->parent(); 41 return node->parent();
40 } 42 }
(...skipping 24 matching lines...) Expand all
65 67
66 AXSerializableTree::~AXSerializableTree() { 68 AXSerializableTree::~AXSerializableTree() {
67 } 69 }
68 70
69 AXTreeSource<const AXNode*, AXNodeData, AXTreeData>* 71 AXTreeSource<const AXNode*, AXNodeData, AXTreeData>*
70 AXSerializableTree::CreateTreeSource() { 72 AXSerializableTree::CreateTreeSource() {
71 return new AXTreeSourceAdapter(this); 73 return new AXTreeSourceAdapter(this);
72 } 74 }
73 75
74 } // namespace ui 76 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/ax_node_data.cc ('k') | ui/accessibility/ax_text_utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698