Chromium Code Reviews| Index: ui/accessibility/platform/ax_android_snapshot.h |
| diff --git a/ui/accessibility/platform/ax_android_snapshot.h b/ui/accessibility/platform/ax_android_snapshot.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..a93899197ec35a46b95c949f71c9451f023210f8 |
| --- /dev/null |
| +++ b/ui/accessibility/platform/ax_android_snapshot.h |
| @@ -0,0 +1,69 @@ |
| +// 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_export.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 { |
|
dmazzoni
2017/04/20 21:04:07
This struct name is fine, but make the file name m
Muyuan
2017/04/21 18:45:11
I can't give it a name that ends in _android.. oth
dmazzoni
2017/04/21 21:28:55
Can't you override that global build rule with a l
|
| + static std::unique_ptr<AXSnapshotNodeAndroid> Create( |
| + const AXTreeUpdate& update); |
| + AXSnapshotNodeAndroid(); |
| + ~AXSnapshotNodeAndroid(); |
| + |
| + gfx::Rect rect; |
| + base::string16 text; |
| + float text_size; |
| + int32_t color; |
| + 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: |
| + DISALLOW_COPY_AND_ASSIGN(AXSnapshotNodeAndroid); |
| +}; |
| + |
| +AX_EXPORT std::string GetClassName(const AXNode* node); |
| + |
| +AX_EXPORT base::string16 GetText(const AXNode* node); |
| + |
| +AX_EXPORT int GetIntAttribute(const AXNode* node, ui::AXIntAttribute); |
| + |
| +AX_EXPORT gfx::Rect GetPageBoundsRect(const AXNode* node, const AXTree* tree); |
| + |
| +AX_EXPORT void FixEmptyBounds(const AXNode* node, |
| + gfx::RectF* bounds, |
| + const AXTree* tree); |
| + |
| +AX_EXPORT gfx::Rect RelativeToAbsoluteBounds(const AXNode* node, |
| + gfx::RectF bounds, |
| + const AXTree* tree); |
| + |
| +} // namespace ui |
| + |
| +#endif // UI_ACCESSIBILITY_PLATFORM_AX_SNAPSHOT_ANDROID_H_ |