OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_win.h" | 5 #include "content/browser/accessibility/browser_accessibility_win.h" |
6 | 6 |
7 #include <UIAutomationClient.h> | 7 #include <UIAutomationClient.h> |
8 #include <UIAutomationCoreApi.h> | 8 #include <UIAutomationCoreApi.h> |
9 | 9 |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 2891 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2902 // | 2902 // |
2903 // Private methods. | 2903 // Private methods. |
2904 // | 2904 // |
2905 | 2905 |
2906 // Called every time this node's data changes. | 2906 // Called every time this node's data changes. |
2907 void BrowserAccessibilityWin::OnDataChanged() { | 2907 void BrowserAccessibilityWin::OnDataChanged() { |
2908 BrowserAccessibility::OnDataChanged(); | 2908 BrowserAccessibility::OnDataChanged(); |
2909 | 2909 |
2910 InitRoleAndState(); | 2910 InitRoleAndState(); |
2911 | 2911 |
| 2912 // Expose autocomplete attribute for combobox and textbox. |
| 2913 StringAttributeToIA2(ui::AX_ATTR_AUTO_COMPLETE, "autocomplete"); |
| 2914 |
2912 // Expose the "display" and "tag" attributes. | 2915 // Expose the "display" and "tag" attributes. |
2913 StringAttributeToIA2(ui::AX_ATTR_DISPLAY, "display"); | 2916 StringAttributeToIA2(ui::AX_ATTR_DISPLAY, "display"); |
2914 StringAttributeToIA2(ui::AX_ATTR_TEXT_INPUT_TYPE, "text-input-type"); | 2917 StringAttributeToIA2(ui::AX_ATTR_TEXT_INPUT_TYPE, "text-input-type"); |
2915 StringAttributeToIA2(ui::AX_ATTR_HTML_TAG, "tag"); | 2918 StringAttributeToIA2(ui::AX_ATTR_HTML_TAG, "tag"); |
2916 StringAttributeToIA2(ui::AX_ATTR_ROLE, "xml-roles"); | 2919 StringAttributeToIA2(ui::AX_ATTR_ROLE, "xml-roles"); |
2917 | 2920 |
2918 // Expose "level" attribute for headings, trees, etc. | 2921 // Expose "level" attribute for headings, trees, etc. |
2919 IntAttributeToIA2(ui::AX_ATTR_HIERARCHICAL_LEVEL, "level"); | 2922 IntAttributeToIA2(ui::AX_ATTR_HIERARCHICAL_LEVEL, "level"); |
2920 | 2923 |
2921 // Expose the set size and position in set for listbox options. | 2924 // Expose the set size and position in set for listbox options. |
(...skipping 451 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3373 base::string16 invalid; | 3376 base::string16 invalid; |
3374 if (GetHtmlAttribute("aria-invalid", &invalid)) | 3377 if (GetHtmlAttribute("aria-invalid", &invalid)) |
3375 ia2_state_ |= IA2_STATE_INVALID_ENTRY; | 3378 ia2_state_ |= IA2_STATE_INVALID_ENTRY; |
3376 | 3379 |
3377 if (GetBoolAttribute(ui::AX_ATTR_BUTTON_MIXED)) | 3380 if (GetBoolAttribute(ui::AX_ATTR_BUTTON_MIXED)) |
3378 ia_state_ |= STATE_SYSTEM_MIXED; | 3381 ia_state_ |= STATE_SYSTEM_MIXED; |
3379 | 3382 |
3380 if (GetBoolAttribute(ui::AX_ATTR_CAN_SET_VALUE)) | 3383 if (GetBoolAttribute(ui::AX_ATTR_CAN_SET_VALUE)) |
3381 ia2_state_ |= IA2_STATE_EDITABLE; | 3384 ia2_state_ |= IA2_STATE_EDITABLE; |
3382 | 3385 |
| 3386 if (!GetStringAttribute(ui::AX_ATTR_AUTO_COMPLETE).empty()) |
| 3387 ia2_state_ |= IA2_STATE_SUPPORTS_AUTOCOMPLETION; |
| 3388 |
3383 base::string16 html_tag = GetString16Attribute( | 3389 base::string16 html_tag = GetString16Attribute( |
3384 ui::AX_ATTR_HTML_TAG); | 3390 ui::AX_ATTR_HTML_TAG); |
3385 ia_role_ = 0; | 3391 ia_role_ = 0; |
3386 ia2_role_ = 0; | 3392 ia2_role_ = 0; |
3387 switch (GetRole()) { | 3393 switch (GetRole()) { |
3388 case ui::AX_ROLE_ALERT: | 3394 case ui::AX_ROLE_ALERT: |
3389 ia_role_ = ROLE_SYSTEM_ALERT; | 3395 ia_role_ = ROLE_SYSTEM_ALERT; |
3390 break; | 3396 break; |
3391 case ui::AX_ROLE_ALERT_DIALOG: | 3397 case ui::AX_ROLE_ALERT_DIALOG: |
3392 ia_role_ = ROLE_SYSTEM_DIALOG; | 3398 ia_role_ = ROLE_SYSTEM_DIALOG; |
(...skipping 440 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3833 // The role should always be set. | 3839 // The role should always be set. |
3834 DCHECK(!role_name_.empty() || ia_role_); | 3840 DCHECK(!role_name_.empty() || ia_role_); |
3835 | 3841 |
3836 // If we didn't explicitly set the IAccessible2 role, make it the same | 3842 // If we didn't explicitly set the IAccessible2 role, make it the same |
3837 // as the MSAA role. | 3843 // as the MSAA role. |
3838 if (!ia2_role_) | 3844 if (!ia2_role_) |
3839 ia2_role_ = ia_role_; | 3845 ia2_role_ = ia_role_; |
3840 } | 3846 } |
3841 | 3847 |
3842 } // namespace content | 3848 } // namespace content |
OLD | NEW |