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