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/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "content/browser/accessibility/browser_accessibility_manager_android.h" | 8 #include "content/browser/accessibility/browser_accessibility_manager_android.h" |
9 #include "content/common/accessibility_messages.h" | 9 #include "content/common/accessibility_messages.h" |
10 | 10 |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 | 92 |
93 bool BrowserAccessibilityAndroid::IsCheckable() const { | 93 bool BrowserAccessibilityAndroid::IsCheckable() const { |
94 bool checkable = false; | 94 bool checkable = false; |
95 bool is_aria_pressed_defined; | 95 bool is_aria_pressed_defined; |
96 bool is_mixed; | 96 bool is_mixed; |
97 GetAriaTristate("aria-pressed", &is_aria_pressed_defined, &is_mixed); | 97 GetAriaTristate("aria-pressed", &is_aria_pressed_defined, &is_mixed); |
98 if (GetRole() == ui::AX_ROLE_CHECK_BOX || | 98 if (GetRole() == ui::AX_ROLE_CHECK_BOX || |
99 GetRole() == ui::AX_ROLE_RADIO_BUTTON || | 99 GetRole() == ui::AX_ROLE_RADIO_BUTTON || |
100 GetRole() == ui::AX_ROLE_MENU_ITEM_CHECK_BOX || | 100 GetRole() == ui::AX_ROLE_MENU_ITEM_CHECK_BOX || |
101 GetRole() == ui::AX_ROLE_MENU_ITEM_RADIO || | 101 GetRole() == ui::AX_ROLE_MENU_ITEM_RADIO || |
| 102 GetRole() == ui::AX_ROLE_CHECK_BOX_MENU_ITEM || |
102 is_aria_pressed_defined) { | 103 is_aria_pressed_defined) { |
103 checkable = true; | 104 checkable = true; |
104 } | 105 } |
105 if (HasState(ui::AX_STATE_CHECKED)) | 106 if (HasState(ui::AX_STATE_CHECKED)) |
106 checkable = true; | 107 checkable = true; |
107 return checkable; | 108 return checkable; |
108 } | 109 } |
109 | 110 |
110 bool BrowserAccessibilityAndroid::IsChecked() const { | 111 bool BrowserAccessibilityAndroid::IsChecked() const { |
111 return HasState(ui::AX_STATE_CHECKED); | 112 return HasState(ui::AX_STATE_CHECKED); |
(...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { | 647 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { |
647 int count = 0; | 648 int count = 0; |
648 for (uint32 i = 0; i < PlatformChildCount(); i++) { | 649 for (uint32 i = 0; i < PlatformChildCount(); i++) { |
649 if (PlatformGetChild(i)->GetRole() == role) | 650 if (PlatformGetChild(i)->GetRole() == role) |
650 count++; | 651 count++; |
651 } | 652 } |
652 return count; | 653 return count; |
653 } | 654 } |
654 | 655 |
655 } // namespace content | 656 } // namespace content |
OLD | NEW |