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

Side by Side Diff: chrome/browser/ui/aura/accessibility/automation_manager_aura.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 unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_AURA_ACCESSIBILITY_AUTOMATION_MANAGER_AURA_H_ 5 #ifndef CHROME_BROWSER_UI_AURA_ACCESSIBILITY_AUTOMATION_MANAGER_AURA_H_
6 #define CHROME_BROWSER_UI_AURA_ACCESSIBILITY_AUTOMATION_MANAGER_AURA_H_ 6 #define CHROME_BROWSER_UI_AURA_ACCESSIBILITY_AUTOMATION_MANAGER_AURA_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <memory> 10 #include <memory>
11 11
12 #include "base/macros.h" 12 #include "base/macros.h"
13 #include "chrome/browser/extensions/api/automation_internal/automation_action_ad apter.h"
14 #include "chrome/browser/ui/aura/accessibility/ax_tree_source_aura.h" 13 #include "chrome/browser/ui/aura/accessibility/ax_tree_source_aura.h"
14 #include "ui/accessibility/ax_host_delegate.h"
15 #include "ui/accessibility/ax_tree_serializer.h" 15 #include "ui/accessibility/ax_tree_serializer.h"
16 #include "ui/views/accessibility/ax_aura_obj_cache.h" 16 #include "ui/views/accessibility/ax_aura_obj_cache.h"
17 17
18 namespace base { 18 namespace base {
19 template <typename T> 19 template <typename T>
20 struct DefaultSingletonTraits; 20 struct DefaultSingletonTraits;
21 } // namespace base 21 } // namespace base
22 22
23 namespace content { 23 namespace content {
24 class BrowserContext; 24 class BrowserContext;
25 } // namespace content 25 } // namespace content
26 26
27 namespace views { 27 namespace views {
28 class AXAuraObjWrapper; 28 class AXAuraObjWrapper;
29 class View; 29 class View;
30 } // namespace views 30 } // namespace views
31 31
32 using AuraAXTreeSerializer = 32 using AuraAXTreeSerializer =
33 ui::AXTreeSerializer<views::AXAuraObjWrapper*, 33 ui::AXTreeSerializer<views::AXAuraObjWrapper*,
34 ui::AXNodeData, 34 ui::AXNodeData,
35 ui::AXTreeData>; 35 ui::AXTreeData>;
36 36
37 // Manages a tree of automation nodes. 37 // Manages a tree of automation nodes.
38 class AutomationManagerAura : public extensions::AutomationActionAdapter, 38 class AutomationManagerAura : public ui::AXHostDelegate,
39 views::AXAuraObjCache::Delegate { 39 views::AXAuraObjCache::Delegate {
40 public: 40 public:
41 // Get the single instance of this class. 41 // Get the single instance of this class.
42 static AutomationManagerAura* GetInstance(); 42 static AutomationManagerAura* GetInstance();
43 43
44 // Enable automation support for views. 44 // Enable automation support for views.
45 void Enable(content::BrowserContext* context); 45 void Enable(content::BrowserContext* context);
46 46
47 // Disable automation support for views. 47 // Disable automation support for views.
48 void Disable(); 48 void Disable();
49 49
50 // Handle an event fired upon a |View|. 50 // Handle an event fired upon a |View|.
51 void HandleEvent(content::BrowserContext* context, 51 void HandleEvent(content::BrowserContext* context,
52 views::View* view, 52 views::View* view,
53 ui::AXEvent event_type); 53 ui::AXEvent event_type);
54 54
55 void HandleAlert(content::BrowserContext* context, const std::string& text); 55 void HandleAlert(content::BrowserContext* context, const std::string& text);
56 56
57 // AutomationActionAdapter implementation. 57 // AXHostDelegate implementation.
58 void PerformAction(const ui::AXActionData& data) override; 58 void PerformAction(const ui::AXActionData& data) override;
59 59
60 // views::AXAuraObjCache::Delegate implementation. 60 // views::AXAuraObjCache::Delegate implementation.
61 void OnChildWindowRemoved(views::AXAuraObjWrapper* parent) override; 61 void OnChildWindowRemoved(views::AXAuraObjWrapper* parent) override;
62 62
63 protected: 63 protected:
64 AutomationManagerAura(); 64 AutomationManagerAura();
65 virtual ~AutomationManagerAura(); 65 ~AutomationManagerAura() override;
66 66
67 private: 67 private:
68 friend struct base::DefaultSingletonTraits<AutomationManagerAura>; 68 friend struct base::DefaultSingletonTraits<AutomationManagerAura>;
69 69
70 // Reset all state in this manager. 70 // Reset all state in this manager.
71 void ResetSerializer(); 71 void ResetSerializer();
72 72
73 void SendEvent(content::BrowserContext* context, 73 void SendEvent(content::BrowserContext* context,
74 views::AXAuraObjWrapper* aura_obj, 74 views::AXAuraObjWrapper* aura_obj,
75 ui::AXEvent event_type); 75 ui::AXEvent event_type);
(...skipping 11 matching lines...) Expand all
87 std::unique_ptr<AuraAXTreeSerializer> current_tree_serializer_; 87 std::unique_ptr<AuraAXTreeSerializer> current_tree_serializer_;
88 88
89 bool processing_events_; 89 bool processing_events_;
90 90
91 std::vector<std::pair<views::AXAuraObjWrapper*, ui::AXEvent>> pending_events_; 91 std::vector<std::pair<views::AXAuraObjWrapper*, ui::AXEvent>> pending_events_;
92 92
93 DISALLOW_COPY_AND_ASSIGN(AutomationManagerAura); 93 DISALLOW_COPY_AND_ASSIGN(AutomationManagerAura);
94 }; 94 };
95 95
96 #endif // CHROME_BROWSER_UI_AURA_ACCESSIBILITY_AUTOMATION_MANAGER_AURA_H_ 96 #endif // CHROME_BROWSER_UI_AURA_ACCESSIBILITY_AUTOMATION_MANAGER_AURA_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698