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

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

Issue 2808383004: Refactor and send voice interaction structure (Closed)
Patch Set: address dominic's review comments 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..923f2fe5a02d2f0ea9b0cdea940a6c380323e561
--- /dev/null
+++ b/ui/accessibility/platform/ax_android_snapshot.h
@@ -0,0 +1,50 @@
+// 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"
dmazzoni 2017/04/20 21:04:07 Unused? I think you're only using it in the cc fil
Muyuan 2017/04/21 18:45:12 Done.
+#include "ui/accessibility/ax_tree_update.h"
dmazzoni 2017/04/20 21:04:07 Forward-declare instead of including this
Muyuan 2017/04/21 18:45:12 AXTreeUpdate seems to be a type alias instead of a
+#include "ui/gfx/geometry/rect.h"
+
+namespace ui {
+
+// 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(
dmazzoni 2017/04/20 21:04:08 Add a comment that this builds a whole tree of AXS
Muyuan 2017/04/21 18:45:12 Done.
+ const AXTreeUpdate& update);
+ AXSnapshotNodeAndroid();
dmazzoni 2017/04/20 21:04:07 Should the constructor be private so that the only
Muyuan 2017/04/21 18:45:12 base::MakeUnique in WalkAXTreeDepthFirst will not
dmazzoni 2017/04/21 21:31:47 private static would make sense to me.
Muyuan 2017/04/25 04:31:06 Done.
+ ~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);
+};
+
+} // namespace ui
+
+#endif // UI_ACCESSIBILITY_PLATFORM_AX_SNAPSHOT_ANDROID_H_

Powered by Google App Engine
This is Rietveld 408576698