Commit d00f8e7f authored by Nektarios Paisios's avatar Nektarios Paisios Committed by Commit Bot

Modernized a few "for" loops in BrowserAccessibilityManagerWin.

R=dmazzoni@chromium.org

Bug: 
Change-Id: I6663a127e00f45975961e5cacf48c6be32facccf
Reviewed-on: https://chromium-review.googlesource.com/596749Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#491414}
parent 2fed30a3
...@@ -372,21 +372,22 @@ void BrowserAccessibilityManagerWin::OnAtomicUpdateFinished( ...@@ -372,21 +372,22 @@ void BrowserAccessibilityManagerWin::OnAtomicUpdateFinished(
// done in a single pass that must complete before the next step starts. // done in a single pass that must complete before the next step starts.
// The first step moves win_attributes_ to old_win_attributes_ and then // The first step moves win_attributes_ to old_win_attributes_ and then
// recomputes all of win_attributes_ other than IAccessibleText. // recomputes all of win_attributes_ other than IAccessibleText.
for (size_t i = 0; i < changes.size(); ++i) { for (const auto& change : changes) {
const ui::AXNode* changed_node = changes[i].node; const ui::AXNode* changed_node = change.node;
DCHECK(changed_node); DCHECK(changed_node);
BrowserAccessibility* obj = GetFromAXNode(changed_node); BrowserAccessibility* obj = GetFromAXNode(changed_node);
if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) {
ToBrowserAccessibilityWin(obj) ToBrowserAccessibilityWin(obj)
->GetCOM() ->GetCOM()
->UpdateStep1ComputeWinAttributes(); ->UpdateStep1ComputeWinAttributes();
}
} }
// The next step updates the hypertext of each node, which is a // The next step updates the hypertext of each node, which is a
// concatenation of all of its child text nodes, so it can't run until // concatenation of all of its child text nodes, so it can't run until
// the text of all of the nodes was computed in the previous step. // the text of all of the nodes was computed in the previous step.
for (size_t i = 0; i < changes.size(); ++i) { for (const auto& change : changes) {
const ui::AXNode* changed_node = changes[i].node; const ui::AXNode* changed_node = change.node;
DCHECK(changed_node); DCHECK(changed_node);
BrowserAccessibility* obj = GetFromAXNode(changed_node); BrowserAccessibility* obj = GetFromAXNode(changed_node);
if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf())
...@@ -401,13 +402,13 @@ void BrowserAccessibilityManagerWin::OnAtomicUpdateFinished( ...@@ -401,13 +402,13 @@ void BrowserAccessibilityManagerWin::OnAtomicUpdateFinished(
// client may walk the tree when it receives any of these events. // client may walk the tree when it receives any of these events.
// At the end, it deletes old_win_attributes_ since they're not needed // At the end, it deletes old_win_attributes_ since they're not needed
// anymore. // anymore.
for (size_t i = 0; i < changes.size(); ++i) { for (const auto& change : changes) {
const ui::AXNode* changed_node = changes[i].node; const ui::AXNode* changed_node = change.node;
DCHECK(changed_node); DCHECK(changed_node);
BrowserAccessibility* obj = GetFromAXNode(changed_node); BrowserAccessibility* obj = GetFromAXNode(changed_node);
if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) { if (obj && obj->IsNative() && !obj->PlatformIsChildOfLeaf()) {
ToBrowserAccessibilityWin(obj)->GetCOM()->UpdateStep3FireEvents( ToBrowserAccessibilityWin(obj)->GetCOM()->UpdateStep3FireEvents(
changes[i].type == AXTreeDelegate::SUBTREE_CREATED); change.type == AXTreeDelegate::SUBTREE_CREATED);
} }
} }
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment