OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |