| 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 3550 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3561 if (ia_state_ & STATE_SYSTEM_SELECTABLE) { | 3561 if (ia_state_ & STATE_SYSTEM_SELECTABLE) { |
| 3562 ia_state_ |= STATE_SYSTEM_FOCUSABLE; | 3562 ia_state_ |= STATE_SYSTEM_FOCUSABLE; |
| 3563 if (HasState(ui::AX_STATE_FOCUSED)) | 3563 if (HasState(ui::AX_STATE_FOCUSED)) |
| 3564 ia_state_ |= STATE_SYSTEM_FOCUSED; | 3564 ia_state_ |= STATE_SYSTEM_FOCUSED; |
| 3565 } | 3565 } |
| 3566 break; | 3566 break; |
| 3567 case ui::AX_ROLE_LIST_ITEM: | 3567 case ui::AX_ROLE_LIST_ITEM: |
| 3568 ia_role_ = ROLE_SYSTEM_LISTITEM; | 3568 ia_role_ = ROLE_SYSTEM_LISTITEM; |
| 3569 ia_state_ |= STATE_SYSTEM_READONLY; | 3569 ia_state_ |= STATE_SYSTEM_READONLY; |
| 3570 break; | 3570 break; |
| 3571 case ui::AX_ROLE_LIST_MARKER: | |
| 3572 ia_role_ = ROLE_SYSTEM_TEXT; | |
| 3573 ia_state_ |= STATE_SYSTEM_READONLY; | |
| 3574 break; | |
| 3575 case ui::AX_ROLE_MATH_ELEMENT: | 3571 case ui::AX_ROLE_MATH_ELEMENT: |
| 3576 ia_role_ = ROLE_SYSTEM_EQUATION; | 3572 ia_role_ = ROLE_SYSTEM_EQUATION; |
| 3577 ia_state_ |= STATE_SYSTEM_READONLY; | 3573 ia_state_ |= STATE_SYSTEM_READONLY; |
| 3578 break; | 3574 break; |
| 3579 case ui::AX_ROLE_MENU: | 3575 case ui::AX_ROLE_MENU: |
| 3580 case ui::AX_ROLE_MENU_BUTTON: | 3576 case ui::AX_ROLE_MENU_BUTTON: |
| 3581 ia_role_ = ROLE_SYSTEM_MENUPOPUP; | 3577 ia_role_ = ROLE_SYSTEM_MENUPOPUP; |
| 3582 break; | 3578 break; |
| 3583 case ui::AX_ROLE_MENU_BAR: | 3579 case ui::AX_ROLE_MENU_BAR: |
| 3584 ia_role_ = ROLE_SYSTEM_MENUBAR; | 3580 ia_role_ = ROLE_SYSTEM_MENUBAR; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3662 break; | 3658 break; |
| 3663 case ui::AX_ROLE_SPIN_BUTTON_PART: | 3659 case ui::AX_ROLE_SPIN_BUTTON_PART: |
| 3664 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; | 3660 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; |
| 3665 break; | 3661 break; |
| 3666 case ui::AX_ROLE_SPLIT_GROUP: | 3662 case ui::AX_ROLE_SPLIT_GROUP: |
| 3667 ia_role_ = ROLE_SYSTEM_CLIENT; | 3663 ia_role_ = ROLE_SYSTEM_CLIENT; |
| 3668 ia2_role_ = IA2_ROLE_SPLIT_PANE; | 3664 ia2_role_ = IA2_ROLE_SPLIT_PANE; |
| 3669 ia_state_ |= STATE_SYSTEM_READONLY; | 3665 ia_state_ |= STATE_SYSTEM_READONLY; |
| 3670 break; | 3666 break; |
| 3671 case ui::AX_ROLE_ANNOTATION: | 3667 case ui::AX_ROLE_ANNOTATION: |
| 3668 case ui::AX_ROLE_LIST_MARKER: |
| 3672 case ui::AX_ROLE_STATIC_TEXT: | 3669 case ui::AX_ROLE_STATIC_TEXT: |
| 3673 ia_role_ = ROLE_SYSTEM_TEXT; | 3670 ia_role_ = ROLE_SYSTEM_STATICTEXT; |
| 3674 ia_state_ |= STATE_SYSTEM_READONLY; | |
| 3675 break; | 3671 break; |
| 3676 case ui::AX_ROLE_STATUS: | 3672 case ui::AX_ROLE_STATUS: |
| 3677 ia_role_ = ROLE_SYSTEM_STATUSBAR; | 3673 ia_role_ = ROLE_SYSTEM_STATUSBAR; |
| 3678 ia_state_ |= STATE_SYSTEM_READONLY; | 3674 ia_state_ |= STATE_SYSTEM_READONLY; |
| 3679 break; | 3675 break; |
| 3680 case ui::AX_ROLE_SPLITTER: | 3676 case ui::AX_ROLE_SPLITTER: |
| 3681 ia_role_ = ROLE_SYSTEM_SEPARATOR; | 3677 ia_role_ = ROLE_SYSTEM_SEPARATOR; |
| 3682 break; | 3678 break; |
| 3683 case ui::AX_ROLE_SVG_ROOT: | 3679 case ui::AX_ROLE_SVG_ROOT: |
| 3684 ia_role_ = ROLE_SYSTEM_GRAPHIC; | 3680 ia_role_ = ROLE_SYSTEM_GRAPHIC; |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3791 // The role should always be set. | 3787 // The role should always be set. |
| 3792 DCHECK(!role_name_.empty() || ia_role_); | 3788 DCHECK(!role_name_.empty() || ia_role_); |
| 3793 | 3789 |
| 3794 // If we didn't explicitly set the IAccessible2 role, make it the same | 3790 // If we didn't explicitly set the IAccessible2 role, make it the same |
| 3795 // as the MSAA role. | 3791 // as the MSAA role. |
| 3796 if (!ia2_role_) | 3792 if (!ia2_role_) |
| 3797 ia2_role_ = ia_role_; | 3793 ia2_role_ = ia_role_; |
| 3798 } | 3794 } |
| 3799 | 3795 |
| 3800 } // namespace content | 3796 } // namespace content |
| OLD | NEW |