Index: content/browser/accessibility/browser_accessibility.cc |
diff --git a/content/browser/accessibility/browser_accessibility.cc b/content/browser/accessibility/browser_accessibility.cc |
index 0fdad54c91c4ef45eac37bfd034aba1e3c644049..e6aea32050a57a1a865b768e151035e9cb38cef2 100644 |
--- a/content/browser/accessibility/browser_accessibility.cc |
+++ b/content/browser/accessibility/browser_accessibility.cc |
@@ -759,6 +759,38 @@ bool BrowserAccessibility::IsWebAreaForPresentationalIframe() const { |
return grandparent->GetRole() == ui::AX_ROLE_IFRAME_PRESENTATIONAL; |
} |
+bool BrowserAccessibility::IsControl() const { |
+ switch (GetRole()) { |
+ case ui::AX_ROLE_BUTTON: |
+ case ui::AX_ROLE_BUTTON_DROP_DOWN: |
+ case ui::AX_ROLE_CHECK_BOX: |
+ case ui::AX_ROLE_COLOR_WELL: |
+ case ui::AX_ROLE_COMBO_BOX: |
+ case ui::AX_ROLE_DISCLOSURE_TRIANGLE: |
+ case ui::AX_ROLE_LIST_BOX: |
+ case ui::AX_ROLE_MENU_BAR: |
+ case ui::AX_ROLE_MENU_BUTTON: |
+ case ui::AX_ROLE_MENU_ITEM: |
+ case ui::AX_ROLE_MENU_ITEM_CHECK_BOX: |
+ case ui::AX_ROLE_MENU_ITEM_RADIO: |
+ case ui::AX_ROLE_MENU: |
+ case ui::AX_ROLE_POP_UP_BUTTON: |
+ case ui::AX_ROLE_RADIO_BUTTON: |
+ case ui::AX_ROLE_SCROLL_BAR: |
+ case ui::AX_ROLE_SEARCH_BOX: |
+ case ui::AX_ROLE_SLIDER: |
+ case ui::AX_ROLE_SPIN_BUTTON: |
+ case ui::AX_ROLE_SWITCH: |
+ case ui::AX_ROLE_TAB: |
+ case ui::AX_ROLE_TEXT_FIELD: |
+ case ui::AX_ROLE_TOGGLE_BUTTON: |
+ case ui::AX_ROLE_TREE: |
+ return true; |
+ default: |
+ return false; |
+ } |
+} |
+ |
int BrowserAccessibility::GetStaticTextLenRecursive() const { |
if (GetRole() == ui::AX_ROLE_STATIC_TEXT || |
GetRole() == ui::AX_ROLE_LINE_BREAK) { |