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