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

Unified Diff: ui/views/accessibility/ax_tree_source_views.h

Issue 196603003: Reland r256396 Add views implementation for AXTreeSource. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 9 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
« no previous file with comments | « ui/accessibility/ax_tree_source.h ('k') | ui/views/accessibility/ax_tree_source_views.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/accessibility/ax_tree_source_views.h
diff --git a/ui/views/accessibility/ax_tree_source_views.h b/ui/views/accessibility/ax_tree_source_views.h
new file mode 100644
index 0000000000000000000000000000000000000000..f55b8600f220c82fa561b2512a646eaab1cf69b9
--- /dev/null
+++ b/ui/views/accessibility/ax_tree_source_views.h
@@ -0,0 +1,52 @@
+// Copyright (c) 2014 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_VIEWS_ACCESSIBILITY_AX_TREE_SOURCE_VIEWS_H_
+#define UI_VIEWS_ACCESSIBILITY_AX_TREE_SOURCE_VIEWS_H_
+
+#include <map>
+
+#include "base/memory/scoped_ptr.h"
+#include "ui/accessibility/ax_tree_source.h"
+#include "ui/views/view.h"
+#include "ui/views/widget/widget_observer.h"
+
+namespace views {
+class AXViewStore;
+
+// This class exposes the views hierarchy as an accessibility tree permitting
+// use with other accessibility classes.
+class VIEWS_EXPORT AXTreeSourceViews : public ui::AXTreeSource<View*>,
+ public WidgetObserver {
+ public:
+ explicit AXTreeSourceViews(Widget* root);
+ virtual ~AXTreeSourceViews();
+
+ // AXTreeSource implementation.
+ virtual View* GetRoot() const OVERRIDE;
+ virtual View* GetFromId(int32 id) const OVERRIDE;
+ virtual int32 GetId(View* node) const OVERRIDE;
+ virtual void GetChildren(View* node,
+ std::vector<View*>* out_children) const OVERRIDE;
+ virtual View* GetParent(View* node) const OVERRIDE;
+ virtual bool IsValid(View* node) const OVERRIDE;
+ virtual bool IsEqual(View* node1,
+ View* node2) const OVERRIDE;
+ virtual View* GetNull() const OVERRIDE;
+ virtual void SerializeNode(
+ View* node, ui::AXNodeData* out_data) const OVERRIDE;
+
+ // WidgetObserver overrides.
+ virtual void OnViewRemoved(Widget* widget, View* view) OVERRIDE;
+ virtual void OnWidgetDestroyed(Widget* widget) OVERRIDE;
+
+ private:
+ scoped_ptr<AXViewStore> view_store_;
+
+ views::Widget* root_;
+};
+
+} // namespace views
+
+#endif // UI_VIEWS_ACCESSIBILITY_AX_TREE_SOURCE_VIEWS_H_
« no previous file with comments | « ui/accessibility/ax_tree_source.h ('k') | ui/views/accessibility/ax_tree_source_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698