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

Unified Diff: chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.h

Issue 2826423003: Expand Chrome OS ARC support to create one tree source per package (Closed)
Patch Set: 1->n mapping from package name to task ids. 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: chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.h
diff --git a/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.h b/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.h
index da0ebbc61ef972c0ce24f6ccc046bdb8c0f85e68..08a6018219794d9f56e54220449f594684341cb7 100644
--- a/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.h
+++ b/chrome/browser/chromeos/arc/accessibility/ax_tree_source_arc.h
@@ -10,6 +10,7 @@
#include <vector>
#include "components/arc/common/accessibility_helper.mojom.h"
+#include "ui/accessibility/ax_host_delegate.h"
#include "ui/accessibility/ax_node.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/ax_tree_data.h"
@@ -17,6 +18,14 @@
#include "ui/accessibility/ax_tree_source.h"
#include "ui/views/view.h"
+namespace aura {
+class Window;
+}
+
+namespace views {
+class View;
+}
+
namespace arc {
using AXTreeArcSerializer =
@@ -28,17 +37,25 @@ using AXTreeArcSerializer =
class AXTreeSourceArc
: public ui::AXTreeSource<mojom::AccessibilityNodeInfoData*,
ui::AXNodeData,
- ui::AXTreeData> {
+ ui::AXTreeData>,
+ public ui::AXHostDelegate {
public:
- explicit AXTreeSourceArc(int32_t tree_id);
+ class Delegate {
+ public:
+ virtual void OnAction(const ui::AXActionData& data) const = 0;
+ };
+
+ explicit AXTreeSourceArc(Delegate* delegate);
~AXTreeSourceArc() override;
// Notify automation of an accessibility event.
void NotifyAccessibilityEvent(mojom::AccessibilityEventData* event_data);
- int32_t tree_id() const { return tree_id_; }
+ void Focus(aura::Window* window);
private:
+ class FocusStealer;
+
// AXTreeSource overrides.
bool GetTreeData(ui::AXTreeData* data) const override;
mojom::AccessibilityNodeInfoData* GetRoot() const override;
@@ -56,12 +73,12 @@ class AXTreeSourceArc
void SerializeNode(mojom::AccessibilityNodeInfoData* node,
ui::AXNodeData* out_data) const override;
+ // AXHostDelegate overrides.
+ void PerformAction(const ui::AXActionData& data) override;
+
// Resets tree state.
void Reset();
- // The id of this tree.
- int32_t tree_id_;
-
// Maps an AccessibilityNodeInfo to its tree data.
std::map<int32_t, mojom::AccessibilityNodeInfoData*> tree_map_;
std::map<int32_t, int32_t> parent_map_;
@@ -69,6 +86,11 @@ class AXTreeSourceArc
int32_t root_id_;
int32_t focused_node_id_;
+ // A delegate that handles accessibility actions on behalf of this tree. The
+ // delegate is valid during the lifetime of this tree.
+ const Delegate* delegate_;
Luis Héctor Chávez 2017/04/26 15:34:59 nit: const Delegate* const delegate_; (or Delegate
David Tseng 2017/04/28 00:27:44 Yup; I know what void* const means :). If we're s
+ std::unique_ptr<FocusStealer> focus_stealer_;
+
DISALLOW_COPY_AND_ASSIGN(AXTreeSourceArc);
};

Powered by Google App Engine
This is Rietveld 408576698