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

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

Issue 862503002: Revert of 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: 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
202 return (GetRole() == ui::AX_ROLE_COLUMN_HEADER || 197 return (GetRole() == ui::AX_ROLE_COLUMN_HEADER ||
203 GetRole() == ui::AX_ROLE_HEADING || 198 GetRole() == ui::AX_ROLE_HEADING ||
204 GetRole() == ui::AX_ROLE_ROW_HEADER); 199 GetRole() == ui::AX_ROLE_ROW_HEADER);
205 } 200 }
206 201
207 bool BrowserAccessibilityAndroid::IsHierarchical() const { 202 bool BrowserAccessibilityAndroid::IsHierarchical() const {
208 return (GetRole() == ui::AX_ROLE_LIST || 203 return (GetRole() == ui::AX_ROLE_LIST ||
209 GetRole() == ui::AX_ROLE_DESCRIPTION_LIST || 204 GetRole() == ui::AX_ROLE_DESCRIPTION_LIST ||
210 GetRole() == ui::AX_ROLE_TREE); 205 GetRole() == ui::AX_ROLE_TREE);
211 } 206 }
(...skipping 660 matching lines...) Expand 10 before | Expand all | Expand 10 after
872 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { 867 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const {
873 int count = 0; 868 int count = 0;
874 for (uint32 i = 0; i < PlatformChildCount(); i++) { 869 for (uint32 i = 0; i < PlatformChildCount(); i++) {
875 if (PlatformGetChild(i)->GetRole() == role) 870 if (PlatformGetChild(i)->GetRole() == role)
876 count++; 871 count++;
877 } 872 }
878 return count; 873 return count;
879 } 874 }
880 875
881 } // namespace content 876 } // 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