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

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

Issue 837123004: Add DumpAccessibilityTree tests (12 of 20) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed link bug 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
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 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
199 GetRole() == ui::AX_ROLE_ROW_HEADER); 199 GetRole() == ui::AX_ROLE_ROW_HEADER);
200 } 200 }
201 201
202 bool BrowserAccessibilityAndroid::IsHierarchical() const { 202 bool BrowserAccessibilityAndroid::IsHierarchical() const {
203 return (GetRole() == ui::AX_ROLE_LIST || 203 return (GetRole() == ui::AX_ROLE_LIST ||
204 GetRole() == ui::AX_ROLE_DESCRIPTION_LIST || 204 GetRole() == ui::AX_ROLE_DESCRIPTION_LIST ||
205 GetRole() == ui::AX_ROLE_TREE); 205 GetRole() == ui::AX_ROLE_TREE);
206 } 206 }
207 207
208 bool BrowserAccessibilityAndroid::IsLink() const { 208 bool BrowserAccessibilityAndroid::IsLink() const {
209 return GetRole() == ui::AX_ROLE_LINK || 209 return (GetRole() == ui::AX_ROLE_LINK ||
210 GetRole() == ui::AX_ROLE_IMAGE_MAP_LINK; 210 GetRole() == ui::AX_ROLE_IMAGE_MAP_LINK);
211 } 211 }
212 212
213 bool BrowserAccessibilityAndroid::IsMultiLine() const { 213 bool BrowserAccessibilityAndroid::IsMultiLine() const {
214 return GetRole() == ui::AX_ROLE_TEXT_AREA; 214 return GetRole() == ui::AX_ROLE_TEXT_AREA;
215 } 215 }
216 216
217 bool BrowserAccessibilityAndroid::IsPassword() const { 217 bool BrowserAccessibilityAndroid::IsPassword() const {
218 return HasState(ui::AX_STATE_PROTECTED); 218 return HasState(ui::AX_STATE_PROTECTED);
219 } 219 }
220 220
(...skipping 646 matching lines...) Expand 10 before | Expand all | Expand 10 after
867 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { 867 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const {
868 int count = 0; 868 int count = 0;
869 for (uint32 i = 0; i < PlatformChildCount(); i++) { 869 for (uint32 i = 0; i < PlatformChildCount(); i++) {
870 if (PlatformGetChild(i)->GetRole() == role) 870 if (PlatformGetChild(i)->GetRole() == role)
871 count++; 871 count++;
872 } 872 }
873 return count; 873 return count;
874 } 874 }
875 875
876 } // namespace content 876 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698