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

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

Issue 2025923002: Reland of Uses the activedescendant_changed event received from Blink to fire the right focus event (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 6 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.h » ('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.h" 5 #include "content/browser/accessibility/browser_accessibility.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 10
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
124 } 124 }
125 125
126 bool BrowserAccessibility::IsTextOnlyObject() const { 126 bool BrowserAccessibility::IsTextOnlyObject() const {
127 return GetRole() == ui::AX_ROLE_STATIC_TEXT || 127 return GetRole() == ui::AX_ROLE_STATIC_TEXT ||
128 GetRole() == ui::AX_ROLE_LINE_BREAK || 128 GetRole() == ui::AX_ROLE_LINE_BREAK ||
129 GetRole() == ui::AX_ROLE_INLINE_TEXT_BOX; 129 GetRole() == ui::AX_ROLE_INLINE_TEXT_BOX;
130 } 130 }
131 131
132 BrowserAccessibility* BrowserAccessibility::PlatformGetChild( 132 BrowserAccessibility* BrowserAccessibility::PlatformGetChild(
133 uint32_t child_index) const { 133 uint32_t child_index) const {
134 DCHECK_LT(child_index, PlatformChildCount());
135 BrowserAccessibility* result = nullptr; 134 BrowserAccessibility* result = nullptr;
136 135
137 if (HasIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)) { 136 if (child_index == 0 && HasIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)) {
138 BrowserAccessibilityManager* child_manager = 137 BrowserAccessibilityManager* child_manager =
139 BrowserAccessibilityManager::FromID( 138 BrowserAccessibilityManager::FromID(
140 GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID)); 139 GetIntAttribute(ui::AX_ATTR_CHILD_TREE_ID));
141 if (child_manager && child_manager->GetRoot()->GetParent() == this) 140 if (child_manager && child_manager->GetRoot()->GetParent() == this)
142 result = child_manager->GetRoot(); 141 result = child_manager->GetRoot();
143 } else { 142 } else {
144 result = InternalGetChild(child_index); 143 result = InternalGetChild(child_index);
145 } 144 }
146 145
147 return result; 146 return result;
(...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after
1187 break; 1186 break;
1188 1187
1189 manager = root->GetParent()->manager(); 1188 manager = root->GetParent()->manager();
1190 root = manager->GetRoot(); 1189 root = manager->GetRoot();
1191 } 1190 }
1192 1191
1193 return bounds; 1192 return bounds;
1194 } 1193 }
1195 1194
1196 } // namespace content 1195 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/accessibility/browser_accessibility_manager.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698