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

Unified Diff: ui/accessibility/ax_host_delegate.h

Issue 2700103004: Initial support for accessibility actions on ARC. (Closed)
Patch Set: Rename cleanup. Created 3 years, 10 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/ax_host_delegate.h
diff --git a/ui/accessibility/ax_host_delegate.h b/ui/accessibility/ax_host_delegate.h
new file mode 100644
index 0000000000000000000000000000000000000000..0d4552e7bf2e2ee67f22196637a63692f40ba637
--- /dev/null
+++ b/ui/accessibility/ax_host_delegate.h
@@ -0,0 +1,40 @@
+// 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_AX_HOST_DELEGATE_H_
+#define UI_ACCESSIBILITY_AX_HOST_DELEGATE_H_
+
+#include "ui/accessibility/ax_action_data.h"
+
+namespace ui {
+
+// Classes that host an accessibility tree in the browser that also wish to
dmazzoni 2017/02/20 04:50:46 "in the browser" could be interpreted to mean that
David Tseng 2017/02/21 19:09:05 That's not quite what it meant to me. Browser proc
+// become visible to accessibility clients (e.g. for relaying targets to source
+// accessibility trees), can subclass this delegate.
+//
+// Subclasses can use |tree_id| when annotating their |AXNodeData| for clients
+// to respond with the appropriate target node id.
+class AX_EXPORT AXHostDelegate {
+ public:
+ AXHostDelegate();
+ virtual ~AXHostDelegate();
+
+ // Handle an action from an accessibility client.
+ virtual void PerformAction(const ui::AXActionData& data) = 0;
+
+ protected:
+ // A tree id appropriate for annotating events sent to an accessibility
+ // client.
+ int32_t tree_id() { return tree_id_; }
+
+ private:
+ // Register or unregister this class with |AXTreeIDRegistry|.
+ void UpdateActiveState(bool active);
+
+ int32_t tree_id_;
+};
+
+} // namespace ui
+
+#endif // UI_ACCESSIBILITY_AX_HOST_DELEGATE_H_

Powered by Google App Engine
This is Rietveld 408576698