| 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 3417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3428 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; | 3428 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; |
| 3429 break; | 3429 break; |
| 3430 case ui::AX_ROLE_CANVAS: | 3430 case ui::AX_ROLE_CANVAS: |
| 3431 if (GetBoolAttribute(ui::AX_ATTR_CANVAS_HAS_FALLBACK)) { | 3431 if (GetBoolAttribute(ui::AX_ATTR_CANVAS_HAS_FALLBACK)) { |
| 3432 role_name_ = L"canvas"; | 3432 role_name_ = L"canvas"; |
| 3433 ia2_role_ = IA2_ROLE_CANVAS; | 3433 ia2_role_ = IA2_ROLE_CANVAS; |
| 3434 } else { | 3434 } else { |
| 3435 ia_role_ = ROLE_SYSTEM_GRAPHIC; | 3435 ia_role_ = ROLE_SYSTEM_GRAPHIC; |
| 3436 } | 3436 } |
| 3437 break; | 3437 break; |
| 3438 case ui::AX_ROLE_CAPTION: |
| 3439 ia_role_ = ROLE_SYSTEM_TEXT; |
| 3440 ia2_role_ = IA2_ROLE_CAPTION; |
| 3441 break; |
| 3438 case ui::AX_ROLE_CELL: | 3442 case ui::AX_ROLE_CELL: |
| 3439 ia_role_ = ROLE_SYSTEM_CELL; | 3443 ia_role_ = ROLE_SYSTEM_CELL; |
| 3440 break; | 3444 break; |
| 3441 case ui::AX_ROLE_CHECK_BOX: | 3445 case ui::AX_ROLE_CHECK_BOX: |
| 3442 ia_role_ = ROLE_SYSTEM_CHECKBUTTON; | 3446 ia_role_ = ROLE_SYSTEM_CHECKBUTTON; |
| 3443 ia2_state_ |= IA2_STATE_CHECKABLE; | 3447 ia2_state_ |= IA2_STATE_CHECKABLE; |
| 3444 break; | 3448 break; |
| 3445 case ui::AX_ROLE_COLOR_WELL: | 3449 case ui::AX_ROLE_COLOR_WELL: |
| 3446 ia_role_ = ROLE_SYSTEM_TEXT; | 3450 ia_role_ = ROLE_SYSTEM_TEXT; |
| 3447 ia2_role_ = IA2_ROLE_COLOR_CHOOSER; | 3451 ia2_role_ = IA2_ROLE_COLOR_CHOOSER; |
| (...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3843 // The role should always be set. | 3847 // The role should always be set. |
| 3844 DCHECK(!role_name_.empty() || ia_role_); | 3848 DCHECK(!role_name_.empty() || ia_role_); |
| 3845 | 3849 |
| 3846 // If we didn't explicitly set the IAccessible2 role, make it the same | 3850 // If we didn't explicitly set the IAccessible2 role, make it the same |
| 3847 // as the MSAA role. | 3851 // as the MSAA role. |
| 3848 if (!ia2_role_) | 3852 if (!ia2_role_) |
| 3849 ia2_role_ = ia_role_; | 3853 ia2_role_ = ia_role_; |
| 3850 } | 3854 } |
| 3851 | 3855 |
| 3852 } // namespace content | 3856 } // namespace content |
| OLD | NEW |