Index: ui/accessibility/platform/ax_snapshot_node_android_platform.h |
diff --git a/ui/accessibility/platform/ax_snapshot_node_android_platform.h b/ui/accessibility/platform/ax_snapshot_node_android_platform.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..e712f8222d780d8c0d66689978f197339157ada8 |
--- /dev/null |
+++ b/ui/accessibility/platform/ax_snapshot_node_android_platform.h |
@@ -0,0 +1,67 @@ |
+// Copyright 2017 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef UI_ACCESSIBILITY_PLATFORM_AX_SNAPSHOT_ANDROID_H_ |
+#define UI_ACCESSIBILITY_PLATFORM_AX_SNAPSHOT_ANDROID_H_ |
+ |
+#include <memory> |
+#include <vector> |
+ |
+#include "base/strings/string16.h" |
+#include "ui/accessibility/ax_enums.h" |
+#include "ui/accessibility/ax_tree_update.h" |
+#include "ui/gfx/geometry/rect.h" |
+ |
+namespace ui { |
+ |
+class AXNode; |
+class AXTree; |
+ |
+// An intermediate representation of the accessibility snapshot |
+// in order to share code between ARC and Android. The field names |
+// are kept consistent with AccessibilitySnapshotNode.java. |
+struct AXSnapshotNodeAndroid { |
+ // Builds a whole tree of AXSnapshotNodeAndroid objects from |
+ // an AxTreeUpdate. |
dmazzoni
2017/04/25 17:06:58
nit: AXTreeUpdate (capitalization)
Muyuan
2017/04/25 17:51:03
Done.
|
+ static std::unique_ptr<AXSnapshotNodeAndroid> Create( |
+ const AXTreeUpdate& update); |
+ |
+ // Returns a fake Android view class that is a closest |
+ // approximation of the AXRole. |
+ static const char* AXRoleToAndroidClassName(AXRole role, bool has_parent); |
+ |
+ ~AXSnapshotNodeAndroid(); |
+ |
+ gfx::Rect rect; |
+ base::string16 text; |
+ float text_size; |
+ int32_t color; |
Luis Héctor Chávez
2017/04/25 18:22:36
iwyu: #include <cstdint>
Muyuan
2017/04/25 19:38:13
Done.
|
+ int32_t bgcolor; |
+ bool bold; |
+ bool italic; |
+ bool underline; |
+ bool line_through; |
+ |
+ bool has_selection; |
+ int32_t start_selection; |
+ int32_t end_selection; |
+ |
+ std::string class_name; |
+ std::vector<std::unique_ptr<AXSnapshotNodeAndroid>> children; |
+ |
+ private: |
+ AXSnapshotNodeAndroid(); |
+ |
+ static std::unique_ptr<AXSnapshotNodeAndroid> WalkAXTreeDepthFirst( |
Luis Héctor Chávez
2017/04/25 18:22:37
does it make sense to move this private static met
Muyuan
2017/04/25 19:38:13
It was moved here to get rid of public constructor
Luis Héctor Chávez
2017/04/25 20:05:32
Acknowledged.
|
+ const AXNode* node, |
+ gfx::Rect rect, |
+ const AXTreeUpdate& update, |
+ const AXTree* tree); |
+ |
+ DISALLOW_COPY_AND_ASSIGN(AXSnapshotNodeAndroid); |
+}; |
+ |
+} // namespace ui |
+ |
+#endif // UI_ACCESSIBILITY_PLATFORM_AX_SNAPSHOT_ANDROID_H_ |