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

Unified Diff: ui/accessibility/platform/ax_android_snapshot.h

Issue 2808383004: Refactor and send voice interaction structure (Closed)
Patch Set: fix WmShell position Created 3 years, 8 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 side-by-side diff with in-line comments
Download patch
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 {
+ 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);
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.
+
+AX_EXPORT base::string16 GetText(const AXNode* node);
+
+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.
+
+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_

Powered by Google App Engine
This is Rietveld 408576698