| 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 3491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3502 case ui::AX_ROLE_ROOT_WEB_AREA: | 3502 case ui::AX_ROLE_ROOT_WEB_AREA: |
| 3503 case ui::AX_ROLE_WEB_AREA: | 3503 case ui::AX_ROLE_WEB_AREA: |
| 3504 ia_role_ = ROLE_SYSTEM_DOCUMENT; | 3504 ia_role_ = ROLE_SYSTEM_DOCUMENT; |
| 3505 ia_state_ |= STATE_SYSTEM_READONLY; | 3505 ia_state_ |= STATE_SYSTEM_READONLY; |
| 3506 ia_state_ |= STATE_SYSTEM_FOCUSABLE; | 3506 ia_state_ |= STATE_SYSTEM_FOCUSABLE; |
| 3507 break; | 3507 break; |
| 3508 case ui::AX_ROLE_EMBEDDED_OBJECT: | 3508 case ui::AX_ROLE_EMBEDDED_OBJECT: |
| 3509 ia_role_ = ROLE_SYSTEM_CLIENT; | 3509 ia_role_ = ROLE_SYSTEM_CLIENT; |
| 3510 ia2_role_ = IA2_ROLE_EMBEDDED_OBJECT; | 3510 ia2_role_ = IA2_ROLE_EMBEDDED_OBJECT; |
| 3511 break; | 3511 break; |
| 3512 case ui::AX_ROLE_EDITABLE_TEXT: | |
| 3513 ia_role_ = ROLE_SYSTEM_TEXT; | |
| 3514 ia2_state_ |= IA2_STATE_SINGLE_LINE; | |
| 3515 ia2_state_ |= IA2_STATE_EDITABLE; | |
| 3516 break; | |
| 3517 case ui::AX_ROLE_FIGCAPTION: | 3512 case ui::AX_ROLE_FIGCAPTION: |
| 3518 role_name_ = html_tag; | 3513 role_name_ = html_tag; |
| 3519 ia2_role_ = IA2_ROLE_CAPTION; | 3514 ia2_role_ = IA2_ROLE_CAPTION; |
| 3520 break; | 3515 break; |
| 3521 case ui::AX_ROLE_FIGURE: | 3516 case ui::AX_ROLE_FIGURE: |
| 3522 ia_role_ = ROLE_SYSTEM_GROUPING; | 3517 ia_role_ = ROLE_SYSTEM_GROUPING; |
| 3523 break; | 3518 break; |
| 3524 case ui::AX_ROLE_FORM: | 3519 case ui::AX_ROLE_FORM: |
| 3525 role_name_ = L"form"; | 3520 role_name_ = L"form"; |
| 3526 ia2_role_ = IA2_ROLE_FORM; | 3521 ia2_role_ = IA2_ROLE_FORM; |
| (...skipping 16 matching lines...) Expand all Loading... |
| 3543 ia_state_ |= STATE_SYSTEM_READONLY; | 3538 ia_state_ |= STATE_SYSTEM_READONLY; |
| 3544 } else { | 3539 } else { |
| 3545 if (html_tag.empty()) | 3540 if (html_tag.empty()) |
| 3546 role_name_ = L"div"; | 3541 role_name_ = L"div"; |
| 3547 else | 3542 else |
| 3548 role_name_ = html_tag; | 3543 role_name_ = html_tag; |
| 3549 ia2_role_ = IA2_ROLE_SECTION; | 3544 ia2_role_ = IA2_ROLE_SECTION; |
| 3550 } | 3545 } |
| 3551 break; | 3546 break; |
| 3552 } | 3547 } |
| 3553 case ui::AX_ROLE_GROW_AREA: | |
| 3554 ia_role_ = ROLE_SYSTEM_GRIP; | |
| 3555 ia_state_ |= STATE_SYSTEM_READONLY; | |
| 3556 break; | |
| 3557 case ui::AX_ROLE_HEADING: | 3548 case ui::AX_ROLE_HEADING: |
| 3558 role_name_ = html_tag; | 3549 role_name_ = html_tag; |
| 3559 ia2_role_ = IA2_ROLE_HEADING; | 3550 ia2_role_ = IA2_ROLE_HEADING; |
| 3560 break; | 3551 break; |
| 3561 case ui::AX_ROLE_IFRAME: | 3552 case ui::AX_ROLE_IFRAME: |
| 3562 ia_role_ = ROLE_SYSTEM_DOCUMENT; | 3553 ia_role_ = ROLE_SYSTEM_DOCUMENT; |
| 3563 ia2_role_ = IA2_ROLE_INTERNAL_FRAME; | 3554 ia2_role_ = IA2_ROLE_INTERNAL_FRAME; |
| 3564 ia_state_ = STATE_SYSTEM_READONLY; | 3555 ia_state_ = STATE_SYSTEM_READONLY; |
| 3565 break; | 3556 break; |
| 3566 case ui::AX_ROLE_IMAGE: | 3557 case ui::AX_ROLE_IMAGE: |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3724 break; | 3715 break; |
| 3725 case ui::AX_ROLE_SLIDER: | 3716 case ui::AX_ROLE_SLIDER: |
| 3726 ia_role_ = ROLE_SYSTEM_SLIDER; | 3717 ia_role_ = ROLE_SYSTEM_SLIDER; |
| 3727 break; | 3718 break; |
| 3728 case ui::AX_ROLE_SPIN_BUTTON: | 3719 case ui::AX_ROLE_SPIN_BUTTON: |
| 3729 ia_role_ = ROLE_SYSTEM_SPINBUTTON; | 3720 ia_role_ = ROLE_SYSTEM_SPINBUTTON; |
| 3730 break; | 3721 break; |
| 3731 case ui::AX_ROLE_SPIN_BUTTON_PART: | 3722 case ui::AX_ROLE_SPIN_BUTTON_PART: |
| 3732 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; | 3723 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; |
| 3733 break; | 3724 break; |
| 3734 case ui::AX_ROLE_SPLIT_GROUP: | |
| 3735 ia_role_ = ROLE_SYSTEM_CLIENT; | |
| 3736 ia2_role_ = IA2_ROLE_SPLIT_PANE; | |
| 3737 ia_state_ |= STATE_SYSTEM_READONLY; | |
| 3738 break; | |
| 3739 case ui::AX_ROLE_ANNOTATION: | 3725 case ui::AX_ROLE_ANNOTATION: |
| 3740 case ui::AX_ROLE_LIST_MARKER: | 3726 case ui::AX_ROLE_LIST_MARKER: |
| 3741 case ui::AX_ROLE_STATIC_TEXT: | 3727 case ui::AX_ROLE_STATIC_TEXT: |
| 3742 ia_role_ = ROLE_SYSTEM_STATICTEXT; | 3728 ia_role_ = ROLE_SYSTEM_STATICTEXT; |
| 3743 break; | 3729 break; |
| 3744 case ui::AX_ROLE_STATUS: | 3730 case ui::AX_ROLE_STATUS: |
| 3745 ia_role_ = ROLE_SYSTEM_STATUSBAR; | 3731 ia_role_ = ROLE_SYSTEM_STATUSBAR; |
| 3746 ia_state_ |= STATE_SYSTEM_READONLY; | 3732 ia_state_ |= STATE_SYSTEM_READONLY; |
| 3747 break; | 3733 break; |
| 3748 case ui::AX_ROLE_SPLITTER: | 3734 case ui::AX_ROLE_SPLITTER: |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3849 // The role should always be set. | 3835 // The role should always be set. |
| 3850 DCHECK(!role_name_.empty() || ia_role_); | 3836 DCHECK(!role_name_.empty() || ia_role_); |
| 3851 | 3837 |
| 3852 // If we didn't explicitly set the IAccessible2 role, make it the same | 3838 // If we didn't explicitly set the IAccessible2 role, make it the same |
| 3853 // as the MSAA role. | 3839 // as the MSAA role. |
| 3854 if (!ia2_role_) | 3840 if (!ia2_role_) |
| 3855 ia2_role_ = ia_role_; | 3841 ia2_role_ = ia_role_; |
| 3856 } | 3842 } |
| 3857 | 3843 |
| 3858 } // namespace content | 3844 } // namespace content |
| OLD | NEW |