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.
5 #ifndef CHROME_BROWSER_UI_AURA_ACCESSIBILITY_AX_TREE_SOURCE_AURA_H_
6 #define CHROME_BROWSER_UI_AURA_ACCESSIBILITY_AX_TREE_SOURCE_AURA_H_
10 #include "base/basictypes.h"
11 #include "base/memory/scoped_ptr.h"
12 #include "chrome/browser/ui/aura/accessibility/ax_root_obj_wrapper.h"
13 #include "ui/accessibility/ax_tree_source.h"
16 class AXAuraObjWrapper
;
19 // This class exposes the views hierarchy as an accessibility tree permitting
20 // use with other accessibility classes.
21 class AXTreeSourceAura
22 : public ui::AXTreeSource
<views::AXAuraObjWrapper
*, ui::AXNodeData
> {
25 ~AXTreeSourceAura() override
;
27 // A set of actions invoked on an Aura view.
28 void DoDefault(int32 id
);
30 void MakeVisible(int32 id
);
31 void SetSelection(int32 id
, int32 start
, int32 end
);
32 void ShowContextMenu(int32 id
);
34 // AXTreeSource implementation.
35 views::AXAuraObjWrapper
* GetRoot() const override
;
36 views::AXAuraObjWrapper
* GetFromId(int32 id
) const override
;
37 int32
GetId(views::AXAuraObjWrapper
* node
) const override
;
39 views::AXAuraObjWrapper
* node
,
40 std::vector
<views::AXAuraObjWrapper
*>* out_children
) const override
;
41 views::AXAuraObjWrapper
* GetParent(
42 views::AXAuraObjWrapper
* node
) const override
;
43 bool IsValid(views::AXAuraObjWrapper
* node
) const override
;
44 bool IsEqual(views::AXAuraObjWrapper
* node1
,
45 views::AXAuraObjWrapper
* node2
) const override
;
46 views::AXAuraObjWrapper
* GetNull() const override
;
47 void SerializeNode(views::AXAuraObjWrapper
* node
,
48 ui::AXNodeData
* out_data
) const override
;
50 // Useful for debugging.
51 std::string
ToString(views::AXAuraObjWrapper
* root
, std::string prefix
);
54 scoped_ptr
<AXRootObjWrapper
> root_
;
56 DISALLOW_COPY_AND_ASSIGN(AXTreeSourceAura
);
59 #endif // CHROME_BROWSER_UI_AURA_ACCESSIBILITY_AX_TREE_SOURCE_AURA_H_