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 3647 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3658 ia_state_ |= STATE_SYSTEM_READONLY; | 3658 ia_state_ |= STATE_SYSTEM_READONLY; |
3659 break; | 3659 break; |
3660 case ui::AX_ROLE_OUTLINE: | 3660 case ui::AX_ROLE_OUTLINE: |
3661 ia_role_ = ROLE_SYSTEM_OUTLINE; | 3661 ia_role_ = ROLE_SYSTEM_OUTLINE; |
3662 break; | 3662 break; |
3663 case ui::AX_ROLE_PARAGRAPH: | 3663 case ui::AX_ROLE_PARAGRAPH: |
3664 role_name_ = L"P"; | 3664 role_name_ = L"P"; |
3665 ia2_role_ = IA2_ROLE_PARAGRAPH; | 3665 ia2_role_ = IA2_ROLE_PARAGRAPH; |
3666 break; | 3666 break; |
3667 case ui::AX_ROLE_POP_UP_BUTTON: | 3667 case ui::AX_ROLE_POP_UP_BUTTON: |
3668 if (html_tag == L"select") { | |
3669 ia_role_ = ROLE_SYSTEM_COMBOBOX; | |
3670 } else { | |
3671 ia_role_ = ROLE_SYSTEM_BUTTONMENU; | 3668 ia_role_ = ROLE_SYSTEM_BUTTONMENU; |
3672 } | |
3673 break; | 3669 break; |
3674 case ui::AX_ROLE_PRE: | 3670 case ui::AX_ROLE_PRE: |
3675 role_name_ = html_tag; | 3671 role_name_ = html_tag; |
3676 ia_role_ = ROLE_SYSTEM_TEXT; | 3672 ia_role_ = ROLE_SYSTEM_TEXT; |
3677 ia2_role_ = IA2_ROLE_PARAGRAPH; | 3673 ia2_role_ = IA2_ROLE_PARAGRAPH; |
3678 break; | 3674 break; |
3679 case ui::AX_ROLE_PROGRESS_INDICATOR: | 3675 case ui::AX_ROLE_PROGRESS_INDICATOR: |
3680 ia_role_ = ROLE_SYSTEM_PROGRESSBAR; | 3676 ia_role_ = ROLE_SYSTEM_PROGRESSBAR; |
3681 ia_state_ |= STATE_SYSTEM_READONLY; | 3677 ia_state_ |= STATE_SYSTEM_READONLY; |
3682 break; | 3678 break; |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3853 // The role should always be set. | 3849 // The role should always be set. |
3854 DCHECK(!role_name_.empty() || ia_role_); | 3850 DCHECK(!role_name_.empty() || ia_role_); |
3855 | 3851 |
3856 // If we didn't explicitly set the IAccessible2 role, make it the same | 3852 // If we didn't explicitly set the IAccessible2 role, make it the same |
3857 // as the MSAA role. | 3853 // as the MSAA role. |
3858 if (!ia2_role_) | 3854 if (!ia2_role_) |
3859 ia2_role_ = ia_role_; | 3855 ia2_role_ = ia_role_; |
3860 } | 3856 } |
3861 | 3857 |
3862 } // namespace content | 3858 } // namespace content |
OLD | NEW |