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 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 | 136 |
137 bool BrowserAccessibilityAndroid::IsContentInvalid() const { | 137 bool BrowserAccessibilityAndroid::IsContentInvalid() const { |
138 std::string invalid; | 138 std::string invalid; |
139 return GetHtmlAttribute("aria-invalid", &invalid); | 139 return GetHtmlAttribute("aria-invalid", &invalid); |
140 } | 140 } |
141 | 141 |
142 bool BrowserAccessibilityAndroid::IsDismissable() const { | 142 bool BrowserAccessibilityAndroid::IsDismissable() const { |
143 return false; // No concept of "dismissable" on the web currently. | 143 return false; // No concept of "dismissable" on the web currently. |
144 } | 144 } |
145 | 145 |
| 146 bool BrowserAccessibilityAndroid::IsEditableText() const { |
| 147 return (GetRole() == ui::AX_ROLE_EDITABLE_TEXT || |
| 148 GetRole() == ui::AX_ROLE_TEXT_AREA || |
| 149 GetRole() == ui::AX_ROLE_TEXT_FIELD); |
| 150 } |
| 151 |
146 bool BrowserAccessibilityAndroid::IsEnabled() const { | 152 bool BrowserAccessibilityAndroid::IsEnabled() const { |
147 return HasState(ui::AX_STATE_ENABLED); | 153 return HasState(ui::AX_STATE_ENABLED); |
148 } | 154 } |
149 | 155 |
150 bool BrowserAccessibilityAndroid::IsFocusable() const { | 156 bool BrowserAccessibilityAndroid::IsFocusable() const { |
151 bool focusable = HasState(ui::AX_STATE_FOCUSABLE); | 157 bool focusable = HasState(ui::AX_STATE_FOCUSABLE); |
152 if (IsIframe() || | 158 if (IsIframe() || |
153 GetRole() == ui::AX_ROLE_WEB_AREA) { | 159 GetRole() == ui::AX_ROLE_WEB_AREA) { |
154 focusable = false; | 160 focusable = false; |
155 } | 161 } |
(...skipping 533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
689 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { | 695 int BrowserAccessibilityAndroid::CountChildrenWithRole(ui::AXRole role) const { |
690 int count = 0; | 696 int count = 0; |
691 for (uint32 i = 0; i < PlatformChildCount(); i++) { | 697 for (uint32 i = 0; i < PlatformChildCount(); i++) { |
692 if (PlatformGetChild(i)->GetRole() == role) | 698 if (PlatformGetChild(i)->GetRole() == role) |
693 count++; | 699 count++; |
694 } | 700 } |
695 return count; | 701 return count; |
696 } | 702 } |
697 | 703 |
698 } // namespace content | 704 } // namespace content |
OLD | NEW |