Chromium Code Reviews| 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 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 62 class CONTENT_EXPORT BrowserAccessibilityFactory { | 62 class CONTENT_EXPORT BrowserAccessibilityFactory { |
| 63 public: | 63 public: |
| 64 virtual ~BrowserAccessibilityFactory() {} | 64 virtual ~BrowserAccessibilityFactory() {} |
| 65 | 65 |
| 66 // Create an instance of BrowserAccessibility and return a new | 66 // Create an instance of BrowserAccessibility and return a new |
| 67 // reference to it. | 67 // reference to it. |
| 68 virtual BrowserAccessibility* Create(); | 68 virtual BrowserAccessibility* Create(); |
| 69 }; | 69 }; |
| 70 | 70 |
| 71 // Manages a tree of BrowserAccessibility objects. | 71 // Manages a tree of BrowserAccessibility objects. |
| 72 class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate { | 72 class CONTENT_EXPORT BrowserAccessibilityManager |
| 73 : public ui::AXTreeDelegate { | |
|
David Tseng
2014/05/01 18:07:54
nit: why was this changed? I think it still fits o
dmazzoni
2014/05/05 07:17:57
Accident. Thanks.
| |
| 73 public: | 74 public: |
| 74 // Creates the platform-specific BrowserAccessibilityManager, but | 75 // Creates the platform-specific BrowserAccessibilityManager, but |
| 75 // with no parent window pointer. Only useful for unit tests. | 76 // with no parent window pointer. Only useful for unit tests. |
| 76 static BrowserAccessibilityManager* Create( | 77 static BrowserAccessibilityManager* Create( |
| 77 const ui::AXTreeUpdate& initial_tree, | 78 const ui::AXTreeUpdate& initial_tree, |
| 78 BrowserAccessibilityDelegate* delegate, | 79 BrowserAccessibilityDelegate* delegate, |
| 79 BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory()); | 80 BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory()); |
| 80 | 81 |
| 81 virtual ~BrowserAccessibilityManager(); | 82 virtual ~BrowserAccessibilityManager(); |
| 82 | 83 |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 171 BrowserAccessibility* PreviousInTreeOrder(BrowserAccessibility* node); | 172 BrowserAccessibility* PreviousInTreeOrder(BrowserAccessibility* node); |
| 172 | 173 |
| 173 // AXTreeDelegate implementation. | 174 // AXTreeDelegate implementation. |
| 174 virtual void OnNodeWillBeDeleted(ui::AXNode* node) OVERRIDE; | 175 virtual void OnNodeWillBeDeleted(ui::AXNode* node) OVERRIDE; |
| 175 virtual void OnNodeCreated(ui::AXNode* node) OVERRIDE; | 176 virtual void OnNodeCreated(ui::AXNode* node) OVERRIDE; |
| 176 virtual void OnNodeChanged(ui::AXNode* node) OVERRIDE; | 177 virtual void OnNodeChanged(ui::AXNode* node) OVERRIDE; |
| 177 virtual void OnNodeCreationFinished(ui::AXNode* node) OVERRIDE; | 178 virtual void OnNodeCreationFinished(ui::AXNode* node) OVERRIDE; |
| 178 virtual void OnNodeChangeFinished(ui::AXNode* node) OVERRIDE; | 179 virtual void OnNodeChangeFinished(ui::AXNode* node) OVERRIDE; |
| 179 virtual void OnRootChanged(ui::AXNode* new_root) OVERRIDE {} | 180 virtual void OnRootChanged(ui::AXNode* new_root) OVERRIDE {} |
| 180 | 181 |
| 182 BrowserAccessibilityDelegate* delegate() const { return delegate_; } | |
| 183 | |
| 184 // Frame tree support. | |
| 185 void SetParentFrameIds(int parent_frame_frame_id, int parent_frame_node_id); | |
| 186 BrowserAccessibility* GetCrossFrameParent(); | |
| 187 | |
| 181 protected: | 188 protected: |
| 182 BrowserAccessibilityManager( | 189 BrowserAccessibilityManager( |
| 183 BrowserAccessibilityDelegate* delegate, | 190 BrowserAccessibilityDelegate* delegate, |
| 184 BrowserAccessibilityFactory* factory); | 191 BrowserAccessibilityFactory* factory); |
| 185 | 192 |
| 186 BrowserAccessibilityManager( | 193 BrowserAccessibilityManager( |
| 187 const ui::AXTreeUpdate& initial_tree, | 194 const ui::AXTreeUpdate& initial_tree, |
| 188 BrowserAccessibilityDelegate* delegate, | 195 BrowserAccessibilityDelegate* delegate, |
| 189 BrowserAccessibilityFactory* factory); | 196 BrowserAccessibilityFactory* factory); |
| 190 | 197 |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 235 | 242 |
| 236 // The underlying tree of accessibility objects. | 243 // The underlying tree of accessibility objects. |
| 237 scoped_ptr<ui::AXTree> tree_; | 244 scoped_ptr<ui::AXTree> tree_; |
| 238 | 245 |
| 239 // The node that currently has focus. | 246 // The node that currently has focus. |
| 240 ui::AXNode* focus_; | 247 ui::AXNode* focus_; |
| 241 | 248 |
| 242 // A mapping from a node id to its wrapper of type BrowserAccessibility. | 249 // A mapping from a node id to its wrapper of type BrowserAccessibility. |
| 243 base::hash_map<int32, BrowserAccessibility*> id_wrapper_map_; | 250 base::hash_map<int32, BrowserAccessibility*> id_wrapper_map_; |
| 244 | 251 |
| 252 // The id of the parent frame and the hosting node within the parent frame. | |
| 253 // The parent frame id can be mapped to another BrowserAccessibilityManager | |
| 254 // using FrameTreeAccessibility. | |
| 255 int32 parent_frame_frame_id_; | |
|
David Tseng
2014/05/01 18:07:54
I would split this comment into separate ones for
dmazzoni
2014/05/05 07:17:57
Done.
| |
| 256 int32 parent_frame_node_id_; | |
| 257 | |
| 245 // The on-screen keyboard state. | 258 // The on-screen keyboard state. |
| 246 OnScreenKeyboardState osk_state_; | 259 OnScreenKeyboardState osk_state_; |
| 247 | 260 |
| 248 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); | 261 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); |
| 249 }; | 262 }; |
| 250 | 263 |
| 251 } // namespace content | 264 } // namespace content |
| 252 | 265 |
| 253 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 266 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| OLD | NEW |