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 3474 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3485 case ui::AX_ROLE_DESCRIPTION_LIST_TERM: | 3485 case ui::AX_ROLE_DESCRIPTION_LIST_TERM: |
3486 ia_role_ = ROLE_SYSTEM_LISTITEM; | 3486 ia_role_ = ROLE_SYSTEM_LISTITEM; |
3487 ia_state_ |= STATE_SYSTEM_READONLY; | 3487 ia_state_ |= STATE_SYSTEM_READONLY; |
3488 break; | 3488 break; |
3489 case ui::AX_ROLE_DETAILS: | 3489 case ui::AX_ROLE_DETAILS: |
3490 role_name_ = html_tag; | 3490 role_name_ = html_tag; |
3491 ia_role_ = ROLE_SYSTEM_GROUPING; | 3491 ia_role_ = ROLE_SYSTEM_GROUPING; |
3492 break; | 3492 break; |
3493 case ui::AX_ROLE_DIALOG: | 3493 case ui::AX_ROLE_DIALOG: |
3494 ia_role_ = ROLE_SYSTEM_DIALOG; | 3494 ia_role_ = ROLE_SYSTEM_DIALOG; |
3495 ia_state_ |= STATE_SYSTEM_READONLY; | |
3496 break; | 3495 break; |
3497 case ui::AX_ROLE_DISCLOSURE_TRIANGLE: | 3496 case ui::AX_ROLE_DISCLOSURE_TRIANGLE: |
3498 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; | 3497 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; |
3499 break; | 3498 break; |
3500 case ui::AX_ROLE_DOCUMENT: | 3499 case ui::AX_ROLE_DOCUMENT: |
3501 case ui::AX_ROLE_ROOT_WEB_AREA: | 3500 case ui::AX_ROLE_ROOT_WEB_AREA: |
3502 case ui::AX_ROLE_WEB_AREA: | 3501 case ui::AX_ROLE_WEB_AREA: |
3503 ia_role_ = ROLE_SYSTEM_DOCUMENT; | 3502 ia_role_ = ROLE_SYSTEM_DOCUMENT; |
3504 ia_state_ |= STATE_SYSTEM_READONLY; | 3503 ia_state_ |= STATE_SYSTEM_READONLY; |
3505 ia_state_ |= STATE_SYSTEM_FOCUSABLE; | 3504 ia_state_ |= STATE_SYSTEM_FOCUSABLE; |
(...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3680 break; | 3679 break; |
3681 case ui::AX_ROLE_PROGRESS_INDICATOR: | 3680 case ui::AX_ROLE_PROGRESS_INDICATOR: |
3682 ia_role_ = ROLE_SYSTEM_PROGRESSBAR; | 3681 ia_role_ = ROLE_SYSTEM_PROGRESSBAR; |
3683 ia_state_ |= STATE_SYSTEM_READONLY; | 3682 ia_state_ |= STATE_SYSTEM_READONLY; |
3684 break; | 3683 break; |
3685 case ui::AX_ROLE_RADIO_BUTTON: | 3684 case ui::AX_ROLE_RADIO_BUTTON: |
3686 ia_role_ = ROLE_SYSTEM_RADIOBUTTON; | 3685 ia_role_ = ROLE_SYSTEM_RADIOBUTTON; |
3687 break; | 3686 break; |
3688 case ui::AX_ROLE_RADIO_GROUP: | 3687 case ui::AX_ROLE_RADIO_GROUP: |
3689 ia_role_ = ROLE_SYSTEM_GROUPING; | 3688 ia_role_ = ROLE_SYSTEM_GROUPING; |
3690 ia2_role_ = IA2_ROLE_SECTION; | |
3691 break; | 3689 break; |
3692 case ui::AX_ROLE_REGION: | 3690 case ui::AX_ROLE_REGION: |
3693 if (html_tag == L"section") { | 3691 if (html_tag == L"section") { |
3694 ia_role_ = ROLE_SYSTEM_GROUPING; | 3692 ia_role_ = ROLE_SYSTEM_GROUPING; |
3695 ia2_role_ = IA2_ROLE_SECTION; | 3693 ia2_role_ = IA2_ROLE_SECTION; |
3696 } else { | 3694 } else { |
3697 ia_role_ = ROLE_SYSTEM_PANE; | 3695 ia_role_ = ROLE_SYSTEM_PANE; |
3698 } | 3696 } |
3699 break; | 3697 break; |
3700 case ui::AX_ROLE_ROW: | 3698 case ui::AX_ROLE_ROW: |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3859 // The role should always be set. | 3857 // The role should always be set. |
3860 DCHECK(!role_name_.empty() || ia_role_); | 3858 DCHECK(!role_name_.empty() || ia_role_); |
3861 | 3859 |
3862 // If we didn't explicitly set the IAccessible2 role, make it the same | 3860 // If we didn't explicitly set the IAccessible2 role, make it the same |
3863 // as the MSAA role. | 3861 // as the MSAA role. |
3864 if (!ia2_role_) | 3862 if (!ia2_role_) |
3865 ia2_role_ = ia_role_; | 3863 ia2_role_ = ia_role_; |
3866 } | 3864 } |
3867 | 3865 |
3868 } // namespace content | 3866 } // namespace content |
OLD | NEW |