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 <stdint.h> |
| 9 |
8 #include <vector> | 10 #include <vector> |
9 | 11 |
10 #include "base/containers/hash_tables.h" | 12 #include "base/containers/hash_tables.h" |
| 13 #include "base/macros.h" |
11 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
12 #include "build/build_config.h" | 15 #include "build/build_config.h" |
13 #include "content/browser/accessibility/ax_tree_id_registry.h" | 16 #include "content/browser/accessibility/ax_tree_id_registry.h" |
14 #include "content/common/content_export.h" | 17 #include "content/common/content_export.h" |
15 #include "content/public/browser/ax_event_notification_details.h" | 18 #include "content/public/browser/ax_event_notification_details.h" |
16 #include "third_party/WebKit/public/web/WebAXEnums.h" | 19 #include "third_party/WebKit/public/web/WebAXEnums.h" |
17 #include "ui/accessibility/ax_node_data.h" | 20 #include "ui/accessibility/ax_node_data.h" |
18 #include "ui/accessibility/ax_serializable_tree.h" | 21 #include "ui/accessibility/ax_serializable_tree.h" |
19 #include "ui/accessibility/ax_tree_update.h" | 22 #include "ui/accessibility/ax_tree_update.h" |
20 #include "ui/gfx/native_widget_types.h" | 23 #include "ui/gfx/native_widget_types.h" |
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 ui::AXEvent event_type, BrowserAccessibility* node) { } | 139 ui::AXEvent event_type, BrowserAccessibility* node) { } |
137 | 140 |
138 // Return a pointer to the root of the tree, does not make a new reference. | 141 // Return a pointer to the root of the tree, does not make a new reference. |
139 BrowserAccessibility* GetRoot(); | 142 BrowserAccessibility* GetRoot(); |
140 | 143 |
141 // Returns a pointer to the BrowserAccessibility object for a given AXNode. | 144 // Returns a pointer to the BrowserAccessibility object for a given AXNode. |
142 BrowserAccessibility* GetFromAXNode(const ui::AXNode* node) const; | 145 BrowserAccessibility* GetFromAXNode(const ui::AXNode* node) const; |
143 | 146 |
144 // Return a pointer to the object corresponding to the given id, | 147 // Return a pointer to the object corresponding to the given id, |
145 // does not make a new reference. | 148 // does not make a new reference. |
146 BrowserAccessibility* GetFromID(int32 id) const; | 149 BrowserAccessibility* GetFromID(int32_t id) const; |
147 | 150 |
148 // If this tree has a parent tree, return the parent node in that tree. | 151 // If this tree has a parent tree, return the parent node in that tree. |
149 BrowserAccessibility* GetParentNodeFromParentTree(); | 152 BrowserAccessibility* GetParentNodeFromParentTree(); |
150 | 153 |
151 // Get the AXTreeData for this frame. | 154 // Get the AXTreeData for this frame. |
152 const ui::AXTreeData& GetTreeData(); | 155 const ui::AXTreeData& GetTreeData(); |
153 | 156 |
154 // Called to notify the accessibility manager that its associated native | 157 // Called to notify the accessibility manager that its associated native |
155 // view got focused. | 158 // view got focused. |
156 virtual void OnWindowFocused(); | 159 virtual void OnWindowFocused(); |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
331 // Factory to create BrowserAccessibility objects (for dependency injection). | 334 // Factory to create BrowserAccessibility objects (for dependency injection). |
332 scoped_ptr<BrowserAccessibilityFactory> factory_; | 335 scoped_ptr<BrowserAccessibilityFactory> factory_; |
333 | 336 |
334 // The underlying tree of accessibility objects. | 337 // The underlying tree of accessibility objects. |
335 scoped_ptr<ui::AXSerializableTree> tree_; | 338 scoped_ptr<ui::AXSerializableTree> tree_; |
336 | 339 |
337 // The node that currently has focus. | 340 // The node that currently has focus. |
338 ui::AXNode* focus_; | 341 ui::AXNode* focus_; |
339 | 342 |
340 // A mapping from a node id to its wrapper of type BrowserAccessibility. | 343 // A mapping from a node id to its wrapper of type BrowserAccessibility. |
341 base::hash_map<int32, BrowserAccessibility*> id_wrapper_map_; | 344 base::hash_map<int32_t, BrowserAccessibility*> id_wrapper_map_; |
342 | 345 |
343 // True if the user has initiated a navigation to another page. | 346 // True if the user has initiated a navigation to another page. |
344 bool user_is_navigating_away_; | 347 bool user_is_navigating_away_; |
345 | 348 |
346 // The on-screen keyboard state. | 349 // The on-screen keyboard state. |
347 OnScreenKeyboardState osk_state_; | 350 OnScreenKeyboardState osk_state_; |
348 | 351 |
349 BrowserAccessibilityFindInPageInfo find_in_page_info_; | 352 BrowserAccessibilityFindInPageInfo find_in_page_info_; |
350 | 353 |
351 // The global ID of this accessibility tree. | 354 // The global ID of this accessibility tree. |
352 AXTreeIDRegistry::AXTreeID ax_tree_id_; | 355 AXTreeIDRegistry::AXTreeID ax_tree_id_; |
353 | 356 |
354 // If this tree has a parent tree, this is the cached ID of the parent | 357 // If this tree has a parent tree, this is the cached ID of the parent |
355 // node within that parent tree. It's computed as needed and cached for | 358 // node within that parent tree. It's computed as needed and cached for |
356 // speed so that it can be accessed quickly if it hasn't changed. | 359 // speed so that it can be accessed quickly if it hasn't changed. |
357 int parent_node_id_from_parent_tree_; | 360 int parent_node_id_from_parent_tree_; |
358 | 361 |
359 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); | 362 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); |
360 }; | 363 }; |
361 | 364 |
362 } // namespace content | 365 } // namespace content |
363 | 366 |
364 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 367 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
OLD | NEW |