| 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 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 90 return BrowserAccessibility::PlatformIsLeaf(); | 90 return BrowserAccessibility::PlatformIsLeaf(); |
| 91 } | 91 } |
| 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 || |
| 101 GetRole() == ui::AX_ROLE_MENU_ITEM_RADIO || |
| 100 is_aria_pressed_defined) { | 102 is_aria_pressed_defined) { |
| 101 checkable = true; | 103 checkable = true; |
| 102 } | 104 } |
| 103 if (HasState(ui::AX_STATE_CHECKED)) | 105 if (HasState(ui::AX_STATE_CHECKED)) |
| 104 checkable = true; | 106 checkable = true; |
| 105 return checkable; | 107 return checkable; |
| 106 } | 108 } |
| 107 | 109 |
| 108 bool BrowserAccessibilityAndroid::IsChecked() const { | 110 bool BrowserAccessibilityAndroid::IsChecked() const { |
| 109 return HasState(ui::AX_STATE_CHECKED); | 111 return HasState(ui::AX_STATE_CHECKED); |
| (...skipping 534 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { | 646 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { |
| 645 int count = 0; | 647 int count = 0; |
| 646 for (uint32 i = 0; i < PlatformChildCount(); i++) { | 648 for (uint32 i = 0; i < PlatformChildCount(); i++) { |
| 647 if (PlatformGetChild(i)->GetRole() == role) | 649 if (PlatformGetChild(i)->GetRole() == role) |
| 648 count++; | 650 count++; |
| 649 } | 651 } |
| 650 return count; | 652 return count; |
| 651 } | 653 } |
| 652 | 654 |
| 653 } // namespace content | 655 } // namespace content |
| OLD | NEW |