Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_ACCESSIBILITY_PLATFORM_AX_SNAPSHOT_ANDROID_H_ | |
| 6 #define UI_ACCESSIBILITY_PLATFORM_AX_SNAPSHOT_ANDROID_H_ | |
| 7 | |
| 8 #include <memory> | |
| 9 #include <vector> | |
| 10 | |
| 11 #include "base/strings/string16.h" | |
| 12 #include "ui/accessibility/ax_export.h" | |
| 13 #include "ui/accessibility/ax_tree_update.h" | |
| 14 #include "ui/gfx/geometry/rect.h" | |
| 15 | |
| 16 namespace ui { | |
| 17 | |
| 18 class AXNode; | |
| 19 class AXTree; | |
| 20 | |
| 21 // An intermediate representation of the accessibility snapshot | |
| 22 // in order to share code between ARC and Android. The field names | |
| 23 // are kept consistent with AccessibilitySnapshotNode.java. | |
| 24 struct AXSnapshotNodeAndroid { | |
| 25 static std::unique_ptr<AXSnapshotNodeAndroid> Create( | |
| 26 const AXTreeUpdate& update); | |
| 27 AXSnapshotNodeAndroid(); | |
| 28 ~AXSnapshotNodeAndroid(); | |
| 29 | |
| 30 gfx::Rect rect; | |
| 31 base::string16 text; | |
| 32 float text_size; | |
| 33 int32_t color; | |
| 34 int32_t bgcolor; | |
| 35 bool bold; | |
| 36 bool italic; | |
| 37 bool underline; | |
| 38 bool line_through; | |
| 39 | |
| 40 bool has_selection; | |
| 41 int32_t start_selection; | |
| 42 int32_t end_selection; | |
| 43 | |
| 44 std::string class_name; | |
| 45 std::vector<std::unique_ptr<AXSnapshotNodeAndroid>> children; | |
| 46 | |
| 47 private: | |
| 48 DISALLOW_COPY_AND_ASSIGN(AXSnapshotNodeAndroid); | |
| 49 }; | |
| 50 | |
| 51 AX_EXPORT std::string GetClassName(const AXNode* node); | |
|
dmazzoni
2017/04/12 20:46:56
Why are the following functions all defined in the
Muyuan
2017/04/12 23:57:11
I'm a bit hesitated here.. I don't know if we real
Muyuan
2017/04/20 00:06:22
Moved details into private namespace.
| |
| 52 | |
| 53 AX_EXPORT base::string16 GetText(const AXNode* node); | |
| 54 | |
| 55 AX_EXPORT int GetIntAttribute(const AXNode* node, ui::AXIntAttribute); | |
|
dmazzoni
2017/04/12 20:46:56
Unused?
Muyuan
2017/04/12 23:57:12
Acknowledged.
Muyuan
2017/04/20 00:06:22
Done.
| |
| 56 | |
| 57 AX_EXPORT gfx::Rect GetPageBoundsRect(const AXNode* node, const AXTree* tree); | |
| 58 | |
| 59 AX_EXPORT void FixEmptyBounds(const AXNode* node, | |
| 60 gfx::RectF* bounds, | |
| 61 const AXTree* tree); | |
| 62 | |
| 63 AX_EXPORT gfx::Rect RelativeToAbsoluteBounds(const AXNode* node, | |
| 64 gfx::RectF bounds, | |
| 65 const AXTree* tree); | |
| 66 | |
| 67 } // namespace ui | |
| 68 | |
| 69 #endif // UI_ACCESSIBILITY_PLATFORM_AX_SNAPSHOT_ANDROID_H_ | |
| OLD | NEW |