OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 5 #ifndef CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 6 #define CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
7 | 7 |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "base/containers/hash_tables.h" | 10 #include "base/containers/hash_tables.h" |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 // Manages a tree of BrowserAccessibility objects. | 87 // Manages a tree of BrowserAccessibility objects. |
88 class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate { | 88 class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate { |
89 public: | 89 public: |
90 // Creates the platform-specific BrowserAccessibilityManager, but | 90 // Creates the platform-specific BrowserAccessibilityManager, but |
91 // with no parent window pointer. Only useful for unit tests. | 91 // with no parent window pointer. Only useful for unit tests. |
92 static BrowserAccessibilityManager* Create( | 92 static BrowserAccessibilityManager* Create( |
93 const ui::AXTreeUpdate& initial_tree, | 93 const ui::AXTreeUpdate& initial_tree, |
94 BrowserAccessibilityDelegate* delegate, | 94 BrowserAccessibilityDelegate* delegate, |
95 BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory()); | 95 BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory()); |
96 | 96 |
97 virtual ~BrowserAccessibilityManager(); | 97 ~BrowserAccessibilityManager() override; |
98 | 98 |
99 void Initialize(const ui::AXTreeUpdate& initial_tree); | 99 void Initialize(const ui::AXTreeUpdate& initial_tree); |
100 | 100 |
101 static ui::AXTreeUpdate GetEmptyDocument(); | 101 static ui::AXTreeUpdate GetEmptyDocument(); |
102 | 102 |
103 virtual void NotifyAccessibilityEvent( | 103 virtual void NotifyAccessibilityEvent( |
104 ui::AXEvent event_type, BrowserAccessibility* node) { } | 104 ui::AXEvent event_type, BrowserAccessibility* node) { } |
105 | 105 |
106 // Return a pointer to the root of the tree, does not make a new reference. | 106 // Return a pointer to the root of the tree, does not make a new reference. |
107 BrowserAccessibility* GetRoot(); | 107 BrowserAccessibility* GetRoot(); |
(...skipping 72 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 | 180 |
181 // True by default, but some platforms want to treat the root | 181 // True by default, but some platforms want to treat the root |
182 // scroll offsets separately. | 182 // scroll offsets separately. |
183 virtual bool UseRootScrollOffsetsWhenComputingBounds(); | 183 virtual bool UseRootScrollOffsetsWhenComputingBounds(); |
184 | 184 |
185 // Walk the tree. | 185 // Walk the tree. |
186 BrowserAccessibility* NextInTreeOrder(BrowserAccessibility* node); | 186 BrowserAccessibility* NextInTreeOrder(BrowserAccessibility* node); |
187 BrowserAccessibility* PreviousInTreeOrder(BrowserAccessibility* node); | 187 BrowserAccessibility* PreviousInTreeOrder(BrowserAccessibility* node); |
188 | 188 |
189 // AXTreeDelegate implementation. | 189 // AXTreeDelegate implementation. |
190 virtual void OnNodeWillBeDeleted(ui::AXNode* node) override; | 190 void OnNodeWillBeDeleted(ui::AXNode* node) override; |
191 virtual void OnNodeCreated(ui::AXNode* node) override; | 191 void OnNodeCreated(ui::AXNode* node) override; |
192 virtual void OnNodeChanged(ui::AXNode* node) override; | 192 void OnNodeChanged(ui::AXNode* node) override; |
193 virtual void OnNodeCreationFinished(ui::AXNode* node) override; | 193 void OnNodeCreationFinished(ui::AXNode* node) override; |
194 virtual void OnNodeChangeFinished(ui::AXNode* node) override; | 194 void OnNodeChangeFinished(ui::AXNode* node) override; |
195 virtual void OnRootChanged(ui::AXNode* new_root) override {} | 195 void OnRootChanged(ui::AXNode* new_root) override {} |
196 | 196 |
197 BrowserAccessibilityDelegate* delegate() const { return delegate_; } | 197 BrowserAccessibilityDelegate* delegate() const { return delegate_; } |
198 void set_delegate(BrowserAccessibilityDelegate* delegate) { | 198 void set_delegate(BrowserAccessibilityDelegate* delegate) { |
199 delegate_ = delegate; | 199 delegate_ = delegate; |
200 } | 200 } |
201 | 201 |
202 // Get a snapshot of the current tree as an AXTreeUpdate. | 202 // Get a snapshot of the current tree as an AXTreeUpdate. |
203 ui::AXTreeUpdate SnapshotAXTreeForTesting(); | 203 ui::AXTreeUpdate SnapshotAXTreeForTesting(); |
204 | 204 |
205 protected: | 205 protected: |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 | 256 |
257 // The on-screen keyboard state. | 257 // The on-screen keyboard state. |
258 OnScreenKeyboardState osk_state_; | 258 OnScreenKeyboardState osk_state_; |
259 | 259 |
260 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); | 260 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); |
261 }; | 261 }; |
262 | 262 |
263 } // namespace content | 263 } // namespace content |
264 | 264 |
265 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 265 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
OLD | NEW |