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

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: Fake out WMHelper Created 3 years, 7 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..b2c43f9a4bdd68f9c83fd2c6db5d6ae60ad02b40 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,10 @@
#include "ui/accessibility/ax_tree_source.h"
#include "ui/views/view.h"
+namespace aura {
+class Window;
+}
+
namespace arc {
using AXTreeArcSerializer =
@@ -28,17 +33,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 +69,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 +82,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* const delegate_;
+ std::unique_ptr<FocusStealer> focus_stealer_;
+
DISALLOW_COPY_AND_ASSIGN(AXTreeSourceArc);
};

Powered by Google App Engine
This is Rietveld 408576698