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 3478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3489 case ui::AX_ROLE_DESCRIPTION_LIST_TERM: | 3489 case ui::AX_ROLE_DESCRIPTION_LIST_TERM: |
3490 ia_role_ = ROLE_SYSTEM_LISTITEM; | 3490 ia_role_ = ROLE_SYSTEM_LISTITEM; |
3491 ia_state_ |= STATE_SYSTEM_READONLY; | 3491 ia_state_ |= STATE_SYSTEM_READONLY; |
3492 break; | 3492 break; |
3493 case ui::AX_ROLE_DETAILS: | 3493 case ui::AX_ROLE_DETAILS: |
3494 role_name_ = html_tag; | 3494 role_name_ = html_tag; |
3495 ia_role_ = ROLE_SYSTEM_GROUPING; | 3495 ia_role_ = ROLE_SYSTEM_GROUPING; |
3496 break; | 3496 break; |
3497 case ui::AX_ROLE_DIALOG: | 3497 case ui::AX_ROLE_DIALOG: |
3498 ia_role_ = ROLE_SYSTEM_DIALOG; | 3498 ia_role_ = ROLE_SYSTEM_DIALOG; |
3499 ia_state_ |= STATE_SYSTEM_READONLY; | |
3500 break; | 3499 break; |
3501 case ui::AX_ROLE_DISCLOSURE_TRIANGLE: | 3500 case ui::AX_ROLE_DISCLOSURE_TRIANGLE: |
3502 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; | 3501 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; |
3503 break; | 3502 break; |
3504 case ui::AX_ROLE_DOCUMENT: | 3503 case ui::AX_ROLE_DOCUMENT: |
3505 case ui::AX_ROLE_ROOT_WEB_AREA: | 3504 case ui::AX_ROLE_ROOT_WEB_AREA: |
3506 case ui::AX_ROLE_WEB_AREA: | 3505 case ui::AX_ROLE_WEB_AREA: |
3507 ia_role_ = ROLE_SYSTEM_DOCUMENT; | 3506 ia_role_ = ROLE_SYSTEM_DOCUMENT; |
3508 ia_state_ |= STATE_SYSTEM_READONLY; | 3507 ia_state_ |= STATE_SYSTEM_READONLY; |
3509 ia_state_ |= STATE_SYSTEM_FOCUSABLE; | 3508 ia_state_ |= STATE_SYSTEM_FOCUSABLE; |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3689 break; | 3688 break; |
3690 case ui::AX_ROLE_PROGRESS_INDICATOR: | 3689 case ui::AX_ROLE_PROGRESS_INDICATOR: |
3691 ia_role_ = ROLE_SYSTEM_PROGRESSBAR; | 3690 ia_role_ = ROLE_SYSTEM_PROGRESSBAR; |
3692 ia_state_ |= STATE_SYSTEM_READONLY; | 3691 ia_state_ |= STATE_SYSTEM_READONLY; |
3693 break; | 3692 break; |
3694 case ui::AX_ROLE_RADIO_BUTTON: | 3693 case ui::AX_ROLE_RADIO_BUTTON: |
3695 ia_role_ = ROLE_SYSTEM_RADIOBUTTON; | 3694 ia_role_ = ROLE_SYSTEM_RADIOBUTTON; |
3696 break; | 3695 break; |
3697 case ui::AX_ROLE_RADIO_GROUP: | 3696 case ui::AX_ROLE_RADIO_GROUP: |
3698 ia_role_ = ROLE_SYSTEM_GROUPING; | 3697 ia_role_ = ROLE_SYSTEM_GROUPING; |
3699 ia2_role_ = IA2_ROLE_SECTION; | |
3700 break; | 3698 break; |
3701 case ui::AX_ROLE_REGION: | 3699 case ui::AX_ROLE_REGION: |
3702 if (html_tag == L"section") { | 3700 if (html_tag == L"section") { |
3703 ia_role_ = ROLE_SYSTEM_GROUPING; | 3701 ia_role_ = ROLE_SYSTEM_GROUPING; |
3704 ia2_role_ = IA2_ROLE_SECTION; | 3702 ia2_role_ = IA2_ROLE_SECTION; |
3705 } else { | 3703 } else { |
3706 ia_role_ = ROLE_SYSTEM_PANE; | 3704 ia_role_ = ROLE_SYSTEM_PANE; |
3707 } | 3705 } |
3708 break; | 3706 break; |
3709 case ui::AX_ROLE_ROW: | 3707 case ui::AX_ROLE_ROW: |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3868 // The role should always be set. | 3866 // The role should always be set. |
3869 DCHECK(!role_name_.empty() || ia_role_); | 3867 DCHECK(!role_name_.empty() || ia_role_); |
3870 | 3868 |
3871 // If we didn't explicitly set the IAccessible2 role, make it the same | 3869 // If we didn't explicitly set the IAccessible2 role, make it the same |
3872 // as the MSAA role. | 3870 // as the MSAA role. |
3873 if (!ia2_role_) | 3871 if (!ia2_role_) |
3874 ia2_role_ = ia_role_; | 3872 ia2_role_ = ia_role_; |
3875 } | 3873 } |
3876 | 3874 |
3877 } // namespace content | 3875 } // namespace content |
OLD | NEW |