| 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_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 | 152 |
| 153 bool BrowserAccessibilityAndroid::IsChecked() const { | 153 bool BrowserAccessibilityAndroid::IsChecked() const { |
| 154 const auto checked_state = static_cast<ui::AXCheckedState>( | 154 const auto checked_state = static_cast<ui::AXCheckedState>( |
| 155 GetIntAttribute(ui::AX_ATTR_CHECKED_STATE)); | 155 GetIntAttribute(ui::AX_ATTR_CHECKED_STATE)); |
| 156 return (checked_state == ui::AX_CHECKED_STATE_TRUE || | 156 return (checked_state == ui::AX_CHECKED_STATE_TRUE || |
| 157 HasState(ui::AX_STATE_PRESSED)); | 157 HasState(ui::AX_STATE_PRESSED)); |
| 158 } | 158 } |
| 159 | 159 |
| 160 bool BrowserAccessibilityAndroid::IsClickable() const { | 160 bool BrowserAccessibilityAndroid::IsClickable() const { |
| 161 // If it has a default action, it's definitely clickable. | 161 // If it has a default action, it's definitely clickable. |
| 162 if (HasIntAttribute(ui::AX_ATTR_ACTION)) | 162 if (HasIntAttribute(ui::AX_ATTR_DEFAULT_ACTION_VERB)) |
| 163 return true; | 163 return true; |
| 164 | 164 |
| 165 // Otherwise return true if it's focusable, but skip web areas and iframes. | 165 // Otherwise return true if it's focusable, but skip web areas and iframes. |
| 166 if (IsIframe() || (GetRole() == ui::AX_ROLE_ROOT_WEB_AREA)) | 166 if (IsIframe() || (GetRole() == ui::AX_ROLE_ROOT_WEB_AREA)) |
| 167 return false; | 167 return false; |
| 168 return IsFocusable(); | 168 return IsFocusable(); |
| 169 } | 169 } |
| 170 | 170 |
| 171 bool BrowserAccessibilityAndroid::IsCollapsed() const { | 171 bool BrowserAccessibilityAndroid::IsCollapsed() const { |
| 172 return HasState(ui::AX_STATE_COLLAPSED); | 172 return HasState(ui::AX_STATE_COLLAPSED); |
| (...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1416 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { | 1416 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { |
| 1417 int count = 0; | 1417 int count = 0; |
| 1418 for (uint32_t i = 0; i < PlatformChildCount(); i++) { | 1418 for (uint32_t i = 0; i < PlatformChildCount(); i++) { |
| 1419 if (PlatformGetChild(i)->GetRole() == role) | 1419 if (PlatformGetChild(i)->GetRole() == role) |
| 1420 count++; | 1420 count++; |
| 1421 } | 1421 } |
| 1422 return count; | 1422 return count; |
| 1423 } | 1423 } |
| 1424 | 1424 |
| 1425 } // namespace content | 1425 } // namespace content |
| OLD | NEW |