| OLD | NEW |
| (Empty) |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef UI_VIEWS_ACCESSIBILITY_AX_TREE_SOURCE_VIEWS_H_ | |
| 6 #define UI_VIEWS_ACCESSIBILITY_AX_TREE_SOURCE_VIEWS_H_ | |
| 7 | |
| 8 #include <map> | |
| 9 | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 #include "ui/accessibility/ax_tree_source.h" | |
| 12 #include "ui/views/view.h" | |
| 13 #include "ui/views/widget/widget_observer.h" | |
| 14 #include "ui/views/widget/widget_removals_observer.h" | |
| 15 | |
| 16 namespace views { | |
| 17 class AXViewStore; | |
| 18 | |
| 19 // This class exposes the views hierarchy as an accessibility tree permitting | |
| 20 // use with other accessibility classes. | |
| 21 class VIEWS_EXPORT AXTreeSourceViews : public ui::AXTreeSource<View*>, | |
| 22 public WidgetObserver, | |
| 23 public WidgetRemovalsObserver { | |
| 24 public: | |
| 25 explicit AXTreeSourceViews(Widget* root); | |
| 26 virtual ~AXTreeSourceViews(); | |
| 27 | |
| 28 // AXTreeSource implementation. | |
| 29 virtual View* GetRoot() const OVERRIDE; | |
| 30 virtual View* GetFromId(int32 id) const OVERRIDE; | |
| 31 virtual int32 GetId(View* node) const OVERRIDE; | |
| 32 virtual void GetChildren(View* node, | |
| 33 std::vector<View*>* out_children) const OVERRIDE; | |
| 34 virtual View* GetParent(View* node) const OVERRIDE; | |
| 35 virtual bool IsValid(View* node) const OVERRIDE; | |
| 36 virtual bool IsEqual(View* node1, | |
| 37 View* node2) const OVERRIDE; | |
| 38 virtual View* GetNull() const OVERRIDE; | |
| 39 virtual void SerializeNode( | |
| 40 View* node, ui::AXNodeData* out_data) const OVERRIDE; | |
| 41 | |
| 42 // WidgetObserver overrides. | |
| 43 virtual void OnWidgetDestroyed(Widget* widget) OVERRIDE; | |
| 44 | |
| 45 // WidgetRemovalsObserver overrides. | |
| 46 virtual void OnWillRemoveView(Widget* widget, View* view) OVERRIDE; | |
| 47 | |
| 48 private: | |
| 49 scoped_ptr<AXViewStore> view_store_; | |
| 50 | |
| 51 views::Widget* root_; | |
| 52 }; | |
| 53 | |
| 54 } // namespace views | |
| 55 | |
| 56 #endif // UI_VIEWS_ACCESSIBILITY_AX_TREE_SOURCE_VIEWS_H_ | |
| OLD | NEW |