| 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 #include "content/browser/accessibility/browser_accessibility_manager.h" | 5 #include "content/browser/accessibility/browser_accessibility_manager.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "build/build_config.h" | 10 #include "build/build_config.h" |
| (...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 } | 386 } |
| 387 | 387 |
| 388 void BrowserAccessibilityManager::OnLocationChanges( | 388 void BrowserAccessibilityManager::OnLocationChanges( |
| 389 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params) { | 389 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params) { |
| 390 for (size_t i = 0; i < params.size(); ++i) { | 390 for (size_t i = 0; i < params.size(); ++i) { |
| 391 BrowserAccessibility* obj = GetFromID(params[i].id); | 391 BrowserAccessibility* obj = GetFromID(params[i].id); |
| 392 if (!obj) | 392 if (!obj) |
| 393 continue; | 393 continue; |
| 394 ui::AXNode* node = obj->node(); | 394 ui::AXNode* node = obj->node(); |
| 395 node->SetLocation(params[i].new_location); | 395 node->SetLocation(params[i].new_location); |
| 396 obj->OnLocationChanged(); | 396 } |
| 397 SendLocationChangeEvents(params); |
| 398 } |
| 399 |
| 400 void BrowserAccessibilityManager::SendLocationChangeEvents( |
| 401 const std::vector<AccessibilityHostMsg_LocationChangeParams>& params) { |
| 402 for (size_t i = 0; i < params.size(); ++i) { |
| 403 BrowserAccessibility* obj = GetFromID(params[i].id); |
| 404 if (obj) |
| 405 obj->OnLocationChanged(); |
| 397 } | 406 } |
| 398 } | 407 } |
| 399 | 408 |
| 400 void BrowserAccessibilityManager::OnFindInPageResult( | 409 void BrowserAccessibilityManager::OnFindInPageResult( |
| 401 int request_id, int match_index, int start_id, int start_offset, | 410 int request_id, int match_index, int start_id, int start_offset, |
| 402 int end_id, int end_offset) { | 411 int end_id, int end_offset) { |
| 403 find_in_page_info_.request_id = request_id; | 412 find_in_page_info_.request_id = request_id; |
| 404 find_in_page_info_.match_index = match_index; | 413 find_in_page_info_.match_index = match_index; |
| 405 find_in_page_info_.start_id = start_id; | 414 find_in_page_info_.start_id = start_id; |
| 406 find_in_page_info_.start_offset = start_offset; | 415 find_in_page_info_.start_offset = start_offset; |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 849 tree_source(tree_->CreateTreeSource()); | 858 tree_source(tree_->CreateTreeSource()); |
| 850 ui::AXTreeSerializer<const ui::AXNode*, | 859 ui::AXTreeSerializer<const ui::AXNode*, |
| 851 ui::AXNodeData, | 860 ui::AXNodeData, |
| 852 ui::AXTreeData> serializer(tree_source.get()); | 861 ui::AXTreeData> serializer(tree_source.get()); |
| 853 ui::AXTreeUpdate update; | 862 ui::AXTreeUpdate update; |
| 854 serializer.SerializeChanges(tree_->root(), &update); | 863 serializer.SerializeChanges(tree_->root(), &update); |
| 855 return update; | 864 return update; |
| 856 } | 865 } |
| 857 | 866 |
| 858 } // namespace content | 867 } // namespace content |
| OLD | NEW |