ExtensionSyncService: listen for relevant changes instead of being explicitly called...
[chromium-blink-merge.git] / chrome / browser / ui / aura / accessibility / ax_tree_source_aura.h
blobc6fdebb9b43ab540c088068e641b624cc252ddad
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_
8 #include <map>
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"
15 namespace views {
16 class AXAuraObjWrapper;
17 } // namespace views
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> {
23 public:
24 AXTreeSourceAura();
25 ~AXTreeSourceAura() override;
27 // A set of actions invoked on an Aura view.
28 void DoDefault(int32 id);
29 void Focus(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;
38 void GetChildren(
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);
53 private:
54 scoped_ptr<AXRootObjWrapper> root_;
56 DISALLOW_COPY_AND_ASSIGN(AXTreeSourceAura);
59 #endif // CHROME_BROWSER_UI_AURA_ACCESSIBILITY_AX_TREE_SOURCE_AURA_H_