| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #include "ui/accessibility/ax_tree.h" | 5 #include "ui/accessibility/ax_tree.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 // This method updates one node in the tree based on serialized data | 173 // This method updates one node in the tree based on serialized data |
| 174 // received in an AXTreeUpdate. See AXTreeUpdate for pre and post | 174 // received in an AXTreeUpdate. See AXTreeUpdate for pre and post |
| 175 // conditions. | 175 // conditions. |
| 176 | 176 |
| 177 // Look up the node by id. If it's not found, then either the root | 177 // Look up the node by id. If it's not found, then either the root |
| 178 // of the tree is being swapped, or we're out of sync with the source | 178 // of the tree is being swapped, or we're out of sync with the source |
| 179 // and this is a serious error. | 179 // and this is a serious error. |
| 180 AXNode* node = GetFromId(src.id); | 180 AXNode* node = GetFromId(src.id); |
| 181 if (node) { | 181 if (node) { |
| 182 update_state->pending_nodes.erase(node); | 182 update_state->pending_nodes.erase(node); |
| 183 if (delegate_) |
| 184 delegate_->OnNodeDataWillChange(node->data(), src); |
| 183 node->SetData(src); | 185 node->SetData(src); |
| 184 } else { | 186 } else { |
| 185 if (src.role != AX_ROLE_ROOT_WEB_AREA && | 187 if (src.role != AX_ROLE_ROOT_WEB_AREA && |
| 186 src.role != AX_ROLE_DESKTOP) { | 188 src.role != AX_ROLE_DESKTOP) { |
| 187 error_ = base::StringPrintf( | 189 error_ = base::StringPrintf( |
| 188 "%d is not in the tree and not the new root", src.id); | 190 "%d is not in the tree and not the new root", src.id); |
| 189 return false; | 191 return false; |
| 190 } | 192 } |
| 191 if (update_state->new_root) { | 193 if (update_state->new_root) { |
| 192 error_ = "Tree update contains two new roots"; | 194 error_ = "Tree update contains two new roots"; |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 305 update_state->pending_nodes.insert(child); | 307 update_state->pending_nodes.insert(child); |
| 306 update_state->new_nodes.insert(child); | 308 update_state->new_nodes.insert(child); |
| 307 } | 309 } |
| 308 new_children->push_back(child); | 310 new_children->push_back(child); |
| 309 } | 311 } |
| 310 | 312 |
| 311 return success; | 313 return success; |
| 312 } | 314 } |
| 313 | 315 |
| 314 } // namespace ui | 316 } // namespace ui |
| OLD | NEW |