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 2910 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2921 GetParent() && | 2921 GetParent() && |
2922 GetParent()->GetRole() == ui::AX_ROLE_LIST_BOX) { | 2922 GetParent()->GetRole() == ui::AX_ROLE_LIST_BOX) { |
2923 ia2_attributes_.push_back( | 2923 ia2_attributes_.push_back( |
2924 L"setsize:" + base::IntToString16(GetParent()->PlatformChildCount())); | 2924 L"setsize:" + base::IntToString16(GetParent()->PlatformChildCount())); |
2925 ia2_attributes_.push_back( | 2925 ia2_attributes_.push_back( |
2926 L"setsize:" + base::IntToString16(GetIndexInParent() + 1)); | 2926 L"setsize:" + base::IntToString16(GetIndexInParent() + 1)); |
2927 } | 2927 } |
2928 | 2928 |
2929 if (ia_role_ == ROLE_SYSTEM_CHECKBUTTON || | 2929 if (ia_role_ == ROLE_SYSTEM_CHECKBUTTON || |
2930 ia_role_ == ROLE_SYSTEM_RADIOBUTTON || | 2930 ia_role_ == ROLE_SYSTEM_RADIOBUTTON || |
| 2931 ia2_role_ == IA2_ROLE_CHECK_MENU_ITEM || |
| 2932 ia2_role_ == IA2_ROLE_RADIO_MENU_ITEM || |
2931 ia2_role_ == IA2_ROLE_TOGGLE_BUTTON) { | 2933 ia2_role_ == IA2_ROLE_TOGGLE_BUTTON) { |
2932 ia2_attributes_.push_back(L"checkable:true"); | 2934 ia2_attributes_.push_back(L"checkable:true"); |
2933 } | 2935 } |
2934 | 2936 |
2935 // Expose live region attributes. | 2937 // Expose live region attributes. |
2936 StringAttributeToIA2(ui::AX_ATTR_LIVE_STATUS, "live"); | 2938 StringAttributeToIA2(ui::AX_ATTR_LIVE_STATUS, "live"); |
2937 StringAttributeToIA2(ui::AX_ATTR_LIVE_RELEVANT, "relevant"); | 2939 StringAttributeToIA2(ui::AX_ATTR_LIVE_RELEVANT, "relevant"); |
2938 BoolAttributeToIA2(ui::AX_ATTR_LIVE_ATOMIC, "atomic"); | 2940 BoolAttributeToIA2(ui::AX_ATTR_LIVE_ATOMIC, "atomic"); |
2939 BoolAttributeToIA2(ui::AX_ATTR_LIVE_BUSY, "busy"); | 2941 BoolAttributeToIA2(ui::AX_ATTR_LIVE_BUSY, "busy"); |
2940 | 2942 |
(...skipping 664 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3605 case ui::AX_ROLE_MENU: | 3607 case ui::AX_ROLE_MENU: |
3606 case ui::AX_ROLE_MENU_BUTTON: | 3608 case ui::AX_ROLE_MENU_BUTTON: |
3607 ia_role_ = ROLE_SYSTEM_MENUPOPUP; | 3609 ia_role_ = ROLE_SYSTEM_MENUPOPUP; |
3608 break; | 3610 break; |
3609 case ui::AX_ROLE_MENU_BAR: | 3611 case ui::AX_ROLE_MENU_BAR: |
3610 ia_role_ = ROLE_SYSTEM_MENUBAR; | 3612 ia_role_ = ROLE_SYSTEM_MENUBAR; |
3611 break; | 3613 break; |
3612 case ui::AX_ROLE_MENU_ITEM: | 3614 case ui::AX_ROLE_MENU_ITEM: |
3613 ia_role_ = ROLE_SYSTEM_MENUITEM; | 3615 ia_role_ = ROLE_SYSTEM_MENUITEM; |
3614 break; | 3616 break; |
| 3617 case ui::AX_ROLE_MENU_ITEM_CHECK_BOX: |
| 3618 ia_role_ = ROLE_SYSTEM_MENUITEM; |
| 3619 ia2_role_ = IA2_ROLE_CHECK_MENU_ITEM; |
| 3620 break; |
| 3621 case ui::AX_ROLE_MENU_ITEM_RADIO: |
| 3622 ia_role_ = ROLE_SYSTEM_MENUITEM; |
| 3623 ia2_role_ = IA2_ROLE_RADIO_MENU_ITEM; |
| 3624 break; |
3615 case ui::AX_ROLE_MENU_LIST_POPUP: | 3625 case ui::AX_ROLE_MENU_LIST_POPUP: |
3616 ia_role_ = ROLE_SYSTEM_CLIENT; | 3626 ia_role_ = ROLE_SYSTEM_CLIENT; |
3617 break; | 3627 break; |
3618 case ui::AX_ROLE_MENU_LIST_OPTION: | 3628 case ui::AX_ROLE_MENU_LIST_OPTION: |
3619 ia_role_ = ROLE_SYSTEM_LISTITEM; | 3629 ia_role_ = ROLE_SYSTEM_LISTITEM; |
3620 if (ia_state_ & STATE_SYSTEM_SELECTABLE) { | 3630 if (ia_state_ & STATE_SYSTEM_SELECTABLE) { |
3621 ia_state_ |= STATE_SYSTEM_FOCUSABLE; | 3631 ia_state_ |= STATE_SYSTEM_FOCUSABLE; |
3622 if (HasState(ui::AX_STATE_FOCUSED)) | 3632 if (HasState(ui::AX_STATE_FOCUSED)) |
3623 ia_state_ |= STATE_SYSTEM_FOCUSED; | 3633 ia_state_ |= STATE_SYSTEM_FOCUSED; |
3624 } | 3634 } |
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3823 // The role should always be set. | 3833 // The role should always be set. |
3824 DCHECK(!role_name_.empty() || ia_role_); | 3834 DCHECK(!role_name_.empty() || ia_role_); |
3825 | 3835 |
3826 // If we didn't explicitly set the IAccessible2 role, make it the same | 3836 // If we didn't explicitly set the IAccessible2 role, make it the same |
3827 // as the MSAA role. | 3837 // as the MSAA role. |
3828 if (!ia2_role_) | 3838 if (!ia2_role_) |
3829 ia2_role_ = ia_role_; | 3839 ia2_role_ = ia_role_; |
3830 } | 3840 } |
3831 | 3841 |
3832 } // namespace content | 3842 } // namespace content |
OLD | NEW |