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

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

Issue 845663002: On Android, links inside headings should be announced as headings by TalkBack (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Updating test case as per latest rebased code Created 5 years, 11 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/dump_accessibility_tree_browsertest.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 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 "content/browser/accessibility/browser_accessibility_android.h" 5 #include "content/browser/accessibility/browser_accessibility_android.h"
6 6
7 #include "base/i18n/break_iterator.h" 7 #include "base/i18n/break_iterator.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "base/strings/stringprintf.h" 9 #include "base/strings/stringprintf.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 focusable = false; 187 focusable = false;
188 } 188 }
189 return focusable; 189 return focusable;
190 } 190 }
191 191
192 bool BrowserAccessibilityAndroid::IsFocused() const { 192 bool BrowserAccessibilityAndroid::IsFocused() const {
193 return manager()->GetFocus(manager()->GetRoot()) == this; 193 return manager()->GetFocus(manager()->GetRoot()) == this;
194 } 194 }
195 195
196 bool BrowserAccessibilityAndroid::IsHeading() const { 196 bool BrowserAccessibilityAndroid::IsHeading() const {
197 BrowserAccessibilityAndroid* parent =
198 static_cast<BrowserAccessibilityAndroid*>(GetParent());
199 if (parent && parent->IsHeading())
200 return true;
201
197 return (GetRole() == ui::AX_ROLE_COLUMN_HEADER || 202 return (GetRole() == ui::AX_ROLE_COLUMN_HEADER ||
198 GetRole() == ui::AX_ROLE_HEADING || 203 GetRole() == ui::AX_ROLE_HEADING ||
199 GetRole() == ui::AX_ROLE_ROW_HEADER); 204 GetRole() == ui::AX_ROLE_ROW_HEADER);
200 } 205 }
201 206
202 bool BrowserAccessibilityAndroid::IsHierarchical() const { 207 bool BrowserAccessibilityAndroid::IsHierarchical() const {
203 return (GetRole() == ui::AX_ROLE_LIST || 208 return (GetRole() == ui::AX_ROLE_LIST ||
204 GetRole() == ui::AX_ROLE_DESCRIPTION_LIST || 209 GetRole() == ui::AX_ROLE_DESCRIPTION_LIST ||
205 GetRole() == ui::AX_ROLE_TREE); 210 GetRole() == ui::AX_ROLE_TREE);
206 } 211 }
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { 872 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const {
868 int count = 0; 873 int count = 0;
869 for (uint32 i = 0; i < PlatformChildCount(); i++) { 874 for (uint32 i = 0; i < PlatformChildCount(); i++) {
870 if (PlatformGetChild(i)->GetRole() == role) 875 if (PlatformGetChild(i)->GetRole() == role)
871 count++; 876 count++;
872 } 877 }
873 return count; 878 return count;
874 } 879 }
875 880
876 } // namespace content 881 } // namespace content
OLDNEW
« no previous file with comments | « no previous file | content/browser/accessibility/dump_accessibility_tree_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698