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 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
126 GetRole() == ui::AX_ROLE_MENU_ITEM_RADIO || | 126 GetRole() == ui::AX_ROLE_MENU_ITEM_RADIO || |
127 is_aria_pressed_defined) { | 127 is_aria_pressed_defined) { |
128 checkable = true; | 128 checkable = true; |
129 } | 129 } |
130 if (HasState(ui::AX_STATE_CHECKED)) | 130 if (HasState(ui::AX_STATE_CHECKED)) |
131 checkable = true; | 131 checkable = true; |
132 return checkable; | 132 return checkable; |
133 } | 133 } |
134 | 134 |
135 bool BrowserAccessibilityAndroid::IsChecked() const { | 135 bool BrowserAccessibilityAndroid::IsChecked() const { |
136 return HasState(ui::AX_STATE_CHECKED); | 136 return (HasState(ui::AX_STATE_CHECKED) || HasState(ui::AX_STATE_PRESSED)); |
137 } | 137 } |
138 | 138 |
139 bool BrowserAccessibilityAndroid::IsClickable() const { | 139 bool BrowserAccessibilityAndroid::IsClickable() const { |
140 return (PlatformIsLeaf() && !GetText().empty()); | 140 return (PlatformIsLeaf() && !GetText().empty()); |
141 } | 141 } |
142 | 142 |
143 bool BrowserAccessibilityAndroid::IsCollection() const { | 143 bool BrowserAccessibilityAndroid::IsCollection() const { |
144 return (GetRole() == ui::AX_ROLE_GRID || | 144 return (GetRole() == ui::AX_ROLE_GRID || |
145 GetRole() == ui::AX_ROLE_LIST || | 145 GetRole() == ui::AX_ROLE_LIST || |
146 GetRole() == ui::AX_ROLE_LIST_BOX || | 146 GetRole() == ui::AX_ROLE_LIST_BOX || |
(...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
858 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { | 858 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { |
859 int count = 0; | 859 int count = 0; |
860 for (uint32 i = 0; i < PlatformChildCount(); i++) { | 860 for (uint32 i = 0; i < PlatformChildCount(); i++) { |
861 if (PlatformGetChild(i)->GetRole() == role) | 861 if (PlatformGetChild(i)->GetRole() == role) |
862 count++; | 862 count++; |
863 } | 863 } |
864 return count; | 864 return count; |
865 } | 865 } |
866 | 866 |
867 } // namespace content | 867 } // namespace content |
OLD | NEW |