| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ | 5 #ifndef CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ |
| 6 #define CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ | 6 #define CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <atlbase.h> | 9 #include <atlbase.h> |
| 10 #include <atlcom.h> | 10 #include <atlcom.h> |
| (...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 75 | 75 |
| 76 // Tell the renderer to do the default action for this node. | 76 // Tell the renderer to do the default action for this node. |
| 77 void DoDefaultAction(const BrowserAccessibility& node); | 77 void DoDefaultAction(const BrowserAccessibility& node); |
| 78 | 78 |
| 79 // Called when the renderer process has notified us of about tree changes. | 79 // Called when the renderer process has notified us of about tree changes. |
| 80 // Send a notification to MSAA clients of the change. | 80 // Send a notification to MSAA clients of the change. |
| 81 void OnAccessibilityNotifications( | 81 void OnAccessibilityNotifications( |
| 82 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params); | 82 const std::vector<ViewHostMsg_AccessibilityNotification_Params>& params); |
| 83 | 83 |
| 84 private: | 84 private: |
| 85 // Recursively compare the IDs of our subtree to a new subtree received |
| 86 // from the renderer and return true if their IDs match exactly. |
| 87 bool CanModifyTreeInPlace( |
| 88 BrowserAccessibility* current_root, |
| 89 const webkit_glue::WebAccessibility& new_root); |
| 90 |
| 91 // Recursively modify a subtree (by reinitializing) to match a new |
| 92 // subtree received from the renderer process. Should only be called |
| 93 // if CanModifyTreeInPlace returned true. |
| 94 void ModifyTreeInPlace( |
| 95 BrowserAccessibility* current_root, |
| 96 const webkit_glue::WebAccessibility& new_root); |
| 97 |
| 85 // Update the accessibility tree with an updated WebAccessibility tree or | 98 // Update the accessibility tree with an updated WebAccessibility tree or |
| 86 // subtree received from the renderer process. Returns the updated node or | 99 // subtree received from the renderer process. First attempts to modify |
| 87 // NULL if no node was updated. | 100 // the tree in place, and if that fails, replaces the entire subtree. |
| 101 // Returns the updated node or NULL if no node was updated. |
| 88 BrowserAccessibility* UpdateTree( | 102 BrowserAccessibility* UpdateTree( |
| 89 const webkit_glue::WebAccessibility& acc_obj); | 103 const webkit_glue::WebAccessibility& acc_obj); |
| 90 | 104 |
| 91 void OnAccessibilityObjectStateChange( | 105 void OnAccessibilityObjectStateChange( |
| 92 const webkit_glue::WebAccessibility& acc_obj); | 106 const webkit_glue::WebAccessibility& acc_obj); |
| 93 void OnAccessibilityObjectChildrenChange( | 107 void OnAccessibilityObjectChildrenChange( |
| 94 const webkit_glue::WebAccessibility& acc_obj); | 108 const webkit_glue::WebAccessibility& acc_obj); |
| 95 void OnAccessibilityObjectFocusChange( | 109 void OnAccessibilityObjectFocusChange( |
| 96 const webkit_glue::WebAccessibility& acc_obj); | 110 const webkit_glue::WebAccessibility& acc_obj); |
| 97 void OnAccessibilityObjectLoadComplete( | 111 void OnAccessibilityObjectLoadComplete( |
| 98 const webkit_glue::WebAccessibility& acc_obj); | 112 const webkit_glue::WebAccessibility& acc_obj); |
| 99 void OnAccessibilityObjectValueChange( | 113 void OnAccessibilityObjectValueChange( |
| 100 const webkit_glue::WebAccessibility& acc_obj); | 114 const webkit_glue::WebAccessibility& acc_obj); |
| 115 void OnAccessibilityObjectTextChange( |
| 116 const webkit_glue::WebAccessibility& acc_obj); |
| 101 | 117 |
| 102 // Returns the next MSAA child id. | 118 // Returns the next MSAA child id. |
| 103 static LONG GetNextChildID(); | 119 static LONG GetNextChildID(); |
| 104 | 120 |
| 105 // Recursively build a tree of BrowserAccessibility objects from | 121 // Recursively build a tree of BrowserAccessibility objects from |
| 106 // the WebAccessibility tree received from the renderer process. | 122 // the WebAccessibility tree received from the renderer process. |
| 107 BrowserAccessibility* CreateAccessibilityTree( | 123 BrowserAccessibility* CreateAccessibilityTree( |
| 108 BrowserAccessibility* parent, | 124 BrowserAccessibility* parent, |
| 109 int child_id, | 125 int child_id, |
| 110 const webkit_glue::WebAccessibility& src, | 126 const webkit_glue::WebAccessibility& src, |
| (...skipping 25 matching lines...) Expand all Loading... |
| 136 | 152 |
| 137 // The next child ID to use; static so that they're global to the process. | 153 // The next child ID to use; static so that they're global to the process. |
| 138 // Screen readers cache these IDs to see if they've seen the same object | 154 // Screen readers cache these IDs to see if they've seen the same object |
| 139 // before so we should avoid reusing them within the same project. | 155 // before so we should avoid reusing them within the same project. |
| 140 static LONG next_child_id_; | 156 static LONG next_child_id_; |
| 141 | 157 |
| 142 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); | 158 DISALLOW_COPY_AND_ASSIGN(BrowserAccessibilityManager); |
| 143 }; | 159 }; |
| 144 | 160 |
| 145 #endif // CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ | 161 #endif // CHROME_BROWSER_BROWSER_ACCESSIBILITY_MANAGER_WIN_H_ |
| OLD | NEW |