| 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> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <memory> | 10 #include <memory> |
| 11 #include <vector> | 11 #include <vector> |
| 12 | 12 |
| 13 #include "base/callback_forward.h" | 13 #include "base/callback_forward.h" |
| 14 #include "base/containers/hash_tables.h" | 14 #include "base/containers/hash_tables.h" |
| 15 #include "base/macros.h" | 15 #include "base/macros.h" |
| 16 #include "build/build_config.h" | 16 #include "build/build_config.h" |
| 17 #include "content/browser/accessibility/ax_tree_id_registry.h" | |
| 18 #include "content/browser/accessibility/browser_accessibility_event.h" | 17 #include "content/browser/accessibility/browser_accessibility_event.h" |
| 19 #include "content/common/content_export.h" | 18 #include "content/common/content_export.h" |
| 20 #include "content/public/browser/ax_event_notification_details.h" | 19 #include "content/public/browser/ax_event_notification_details.h" |
| 21 #include "third_party/WebKit/public/web/WebAXEnums.h" | 20 #include "third_party/WebKit/public/web/WebAXEnums.h" |
| 22 #include "ui/accessibility/ax_action_data.h" | 21 #include "ui/accessibility/ax_action_data.h" |
| 23 #include "ui/accessibility/ax_node_data.h" | 22 #include "ui/accessibility/ax_node_data.h" |
| 24 #include "ui/accessibility/ax_serializable_tree.h" | 23 #include "ui/accessibility/ax_serializable_tree.h" |
| 24 #include "ui/accessibility/ax_tree_id_registry.h" |
| 25 #include "ui/accessibility/ax_tree_update.h" | 25 #include "ui/accessibility/ax_tree_update.h" |
| 26 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
| 27 | 27 |
| 28 struct AccessibilityHostMsg_LocationChangeParams; | 28 struct AccessibilityHostMsg_LocationChangeParams; |
| 29 | 29 |
| 30 namespace content { | 30 namespace content { |
| 31 class BrowserAccessibility; | 31 class BrowserAccessibility; |
| 32 class BrowserAccessibilityManager; | 32 class BrowserAccessibilityManager; |
| 33 #if defined(OS_ANDROID) | 33 #if defined(OS_ANDROID) |
| 34 class BrowserAccessibilityManagerAndroid; | 34 class BrowserAccessibilityManagerAndroid; |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate { | 109 class CONTENT_EXPORT BrowserAccessibilityManager : public ui::AXTreeDelegate { |
| 110 public: | 110 public: |
| 111 // Creates the platform-specific BrowserAccessibilityManager, but | 111 // Creates the platform-specific BrowserAccessibilityManager, but |
| 112 // with no parent window pointer. Only useful for unit tests. | 112 // with no parent window pointer. Only useful for unit tests. |
| 113 static BrowserAccessibilityManager* Create( | 113 static BrowserAccessibilityManager* Create( |
| 114 const ui::AXTreeUpdate& initial_tree, | 114 const ui::AXTreeUpdate& initial_tree, |
| 115 BrowserAccessibilityDelegate* delegate, | 115 BrowserAccessibilityDelegate* delegate, |
| 116 BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory()); | 116 BrowserAccessibilityFactory* factory = new BrowserAccessibilityFactory()); |
| 117 | 117 |
| 118 static BrowserAccessibilityManager* FromID( | 118 static BrowserAccessibilityManager* FromID( |
| 119 AXTreeIDRegistry::AXTreeID ax_tree_id); | 119 ui::AXTreeIDRegistry::AXTreeID ax_tree_id); |
| 120 | 120 |
| 121 ~BrowserAccessibilityManager() override; | 121 ~BrowserAccessibilityManager() override; |
| 122 | 122 |
| 123 void Initialize(const ui::AXTreeUpdate& initial_tree); | 123 void Initialize(const ui::AXTreeUpdate& initial_tree); |
| 124 | 124 |
| 125 static ui::AXTreeUpdate GetEmptyDocument(); | 125 static ui::AXTreeUpdate GetEmptyDocument(); |
| 126 | 126 |
| 127 virtual void NotifyAccessibilityEvent( | 127 virtual void NotifyAccessibilityEvent( |
| 128 BrowserAccessibilityEvent::Source source, | 128 BrowserAccessibilityEvent::Source source, |
| 129 ui::AXEvent event_type, | 129 ui::AXEvent event_type, |
| (...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 316 const BrowserAccessibility& end_object, | 316 const BrowserAccessibility& end_object, |
| 317 int end_offset); | 317 int end_offset); |
| 318 | 318 |
| 319 static gfx::Rect GetPageBoundsForRange( | 319 static gfx::Rect GetPageBoundsForRange( |
| 320 const BrowserAccessibility& start_object, | 320 const BrowserAccessibility& start_object, |
| 321 int start_offset, | 321 int start_offset, |
| 322 const BrowserAccessibility& end_object, | 322 const BrowserAccessibility& end_object, |
| 323 int end_offset); | 323 int end_offset); |
| 324 | 324 |
| 325 // Accessors. | 325 // Accessors. |
| 326 AXTreeIDRegistry::AXTreeID ax_tree_id() const { return ax_tree_id_; } | 326 ui::AXTreeIDRegistry::AXTreeID ax_tree_id() const { return ax_tree_id_; } |
| 327 | 327 |
| 328 // AXTreeDelegate implementation. | 328 // AXTreeDelegate implementation. |
| 329 void OnNodeDataWillChange(ui::AXTree* tree, | 329 void OnNodeDataWillChange(ui::AXTree* tree, |
| 330 const ui::AXNodeData& old_node_data, | 330 const ui::AXNodeData& old_node_data, |
| 331 const ui::AXNodeData& new_node_data) override; | 331 const ui::AXNodeData& new_node_data) override; |
| 332 void OnTreeDataChanged(ui::AXTree* tree) override; | 332 void OnTreeDataChanged(ui::AXTree* tree) override; |
| 333 void OnNodeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; | 333 void OnNodeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; |
| 334 void OnSubtreeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; | 334 void OnSubtreeWillBeDeleted(ui::AXTree* tree, ui::AXNode* node) override; |
| 335 void OnNodeWillBeReparented(ui::AXTree* tree, ui::AXNode* node) override; | 335 void OnNodeWillBeReparented(ui::AXTree* tree, ui::AXNode* node) override; |
| 336 void OnSubtreeWillBeReparented(ui::AXTree* tree, ui::AXNode* node) override; | 336 void OnSubtreeWillBeReparented(ui::AXTree* tree, ui::AXNode* node) override; |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 448 int last_hover_ax_tree_id_; | 448 int last_hover_ax_tree_id_; |
| 449 int last_hover_node_id_; | 449 int last_hover_node_id_; |
| 450 gfx::Rect last_hover_bounds_; | 450 gfx::Rect last_hover_bounds_; |
| 451 | 451 |
| 452 // True if the root's parent is in another accessibility tree and that | 452 // True if the root's parent is in another accessibility tree and that |
| 453 // parent's child is the root. Ensures that the parent node is notified | 453 // parent's child is the root. Ensures that the parent node is notified |
| 454 // once when this subtree is first connected. | 454 // once when this subtree is first connected. |
| 455 bool connected_to_parent_tree_node_; | 455 bool connected_to_parent_tree_node_; |
| 456 | 456 |
| 457 // The global ID of this accessibility tree. | 457 // The global ID of this accessibility tree. |
| 458 AXTreeIDRegistry::AXTreeID ax_tree_id_; | 458 ui::AXTreeIDRegistry::AXTreeID ax_tree_id_; |
| 459 | 459 |
| 460 // If this tree has a parent tree, this is the cached ID of the parent | 460 // If this tree has a parent tree, this is the cached ID of the parent |
| 461 // node within that parent tree. It's computed as needed and cached for | 461 // node within that parent tree. It's computed as needed and cached for |
| 462 // speed so that it can be accessed quickly if it hasn't changed. | 462 // speed so that it can be accessed quickly if it hasn't changed. |
| 463 int parent_node_id_from_parent_tree_; | 463 int parent_node_id_from_parent_tree_; |
| 464 | 464 |
| 465 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); | 465 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); |
| 466 }; | 466 }; |
| 467 | 467 |
| 468 } // namespace content | 468 } // namespace content |
| 469 | 469 |
| 470 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ | 470 #endif // CONTENT_BROWSER_ACCESSIBILITY_BROWSER_ACCESSIBILITY_MANAGER_H_ |
| OLD | NEW |