| 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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 | 169 |
| 170 bool BrowserAccessibilityAndroid::IsDismissable() const { | 170 bool BrowserAccessibilityAndroid::IsDismissable() const { |
| 171 return false; // No concept of "dismissable" on the web currently. | 171 return false; // No concept of "dismissable" on the web currently. |
| 172 } | 172 } |
| 173 | 173 |
| 174 bool BrowserAccessibilityAndroid::IsEditableText() const { | 174 bool BrowserAccessibilityAndroid::IsEditableText() const { |
| 175 return GetRole() == ui::AX_ROLE_TEXT_FIELD; | 175 return GetRole() == ui::AX_ROLE_TEXT_FIELD; |
| 176 } | 176 } |
| 177 | 177 |
| 178 bool BrowserAccessibilityAndroid::IsEnabled() const { | 178 bool BrowserAccessibilityAndroid::IsEnabled() const { |
| 179 return HasState(ui::AX_STATE_ENABLED); | 179 return !HasState(ui::AX_STATE_DISABLED); |
| 180 } | 180 } |
| 181 | 181 |
| 182 bool BrowserAccessibilityAndroid::IsFocusable() const { | 182 bool BrowserAccessibilityAndroid::IsFocusable() const { |
| 183 bool focusable = HasState(ui::AX_STATE_FOCUSABLE); | 183 bool focusable = HasState(ui::AX_STATE_FOCUSABLE); |
| 184 if (IsIframe() || | 184 if (IsIframe() || |
| 185 GetRole() == ui::AX_ROLE_WEB_AREA) { | 185 GetRole() == ui::AX_ROLE_WEB_AREA) { |
| 186 focusable = false; | 186 focusable = false; |
| 187 } | 187 } |
| 188 return focusable; | 188 return focusable; |
| 189 } | 189 } |
| (...skipping 685 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { | 875 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { |
| 876 int count = 0; | 876 int count = 0; |
| 877 for (uint32 i = 0; i < PlatformChildCount(); i++) { | 877 for (uint32 i = 0; i < PlatformChildCount(); i++) { |
| 878 if (PlatformGetChild(i)->GetRole() == role) | 878 if (PlatformGetChild(i)->GetRole() == role) |
| 879 count++; | 879 count++; |
| 880 } | 880 } |
| 881 return count; | 881 return count; |
| 882 } | 882 } |
| 883 | 883 |
| 884 } // namespace content | 884 } // namespace content |
| OLD | NEW |