Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(155)

Side by Side Diff: content/browser/accessibility/browser_accessibility_manager.cc

Issue 2408843002: Use BrowserAccessibility::GetClosestPlatformObject consistently (Closed)
Patch Set: Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility_manager_android.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 452 matching lines...) Expand 10 before | Expand all | Expand 10 after
463 int request_id) { 463 int request_id) {
464 find_in_page_info_.active_request_id = request_id; 464 find_in_page_info_.active_request_id = request_id;
465 if (find_in_page_info_.request_id != request_id) 465 if (find_in_page_info_.request_id != request_id)
466 return; 466 return;
467 467
468 BrowserAccessibility* node = GetFromID(find_in_page_info_.start_id); 468 BrowserAccessibility* node = GetFromID(find_in_page_info_.start_id);
469 if (!node) 469 if (!node)
470 return; 470 return;
471 471
472 // If an ancestor of this node is a leaf node, fire the notification on that. 472 // If an ancestor of this node is a leaf node, fire the notification on that.
473 BrowserAccessibility* ancestor = node->GetParent(); 473 node = node->GetClosestPlatformObject();
474 while (ancestor && ancestor != GetRoot()) {
475 if (ancestor->PlatformIsLeaf())
476 node = ancestor;
477 ancestor = ancestor->GetParent();
478 }
479 474
480 // The "scrolled to anchor" notification is a great way to get a 475 // The "scrolled to anchor" notification is a great way to get a
481 // screen reader to jump directly to a specific location in a document. 476 // screen reader to jump directly to a specific location in a document.
482 NotifyAccessibilityEvent( 477 NotifyAccessibilityEvent(
483 BrowserAccessibilityEvent::FromFindInPageResult, 478 BrowserAccessibilityEvent::FromFindInPageResult,
484 ui::AX_EVENT_SCROLLED_TO_ANCHOR, 479 ui::AX_EVENT_SCROLLED_TO_ANCHOR,
485 node); 480 node);
486 } 481 }
487 482
488 BrowserAccessibility* BrowserAccessibilityManager::GetActiveDescendant( 483 BrowserAccessibility* BrowserAccessibilityManager::GetActiveDescendant(
(...skipping 600 matching lines...) Expand 10 before | Expand all | Expand 10 after
1089 tree_source(tree_->CreateTreeSource()); 1084 tree_source(tree_->CreateTreeSource());
1090 ui::AXTreeSerializer<const ui::AXNode*, 1085 ui::AXTreeSerializer<const ui::AXNode*,
1091 ui::AXNodeData, 1086 ui::AXNodeData,
1092 ui::AXTreeData> serializer(tree_source.get()); 1087 ui::AXTreeData> serializer(tree_source.get());
1093 ui::AXTreeUpdate update; 1088 ui::AXTreeUpdate update;
1094 serializer.SerializeChanges(tree_->root(), &update); 1089 serializer.SerializeChanges(tree_->root(), &update);
1095 return update; 1090 return update;
1096 } 1091 }
1097 1092
1098 } // namespace content 1093 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility_manager_android.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698