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 3340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3351 if (HasState(ui::AX_STATE_REQUIRED)) | 3351 if (HasState(ui::AX_STATE_REQUIRED)) |
3352 ia2_state_ |= IA2_STATE_REQUIRED; | 3352 ia2_state_ |= IA2_STATE_REQUIRED; |
3353 if (HasState(ui::AX_STATE_SELECTABLE)) | 3353 if (HasState(ui::AX_STATE_SELECTABLE)) |
3354 ia_state_ |= STATE_SYSTEM_SELECTABLE; | 3354 ia_state_ |= STATE_SYSTEM_SELECTABLE; |
3355 if (HasState(ui::AX_STATE_SELECTED)) | 3355 if (HasState(ui::AX_STATE_SELECTED)) |
3356 ia_state_ |= STATE_SYSTEM_SELECTED; | 3356 ia_state_ |= STATE_SYSTEM_SELECTED; |
3357 if (HasState(ui::AX_STATE_VISITED)) | 3357 if (HasState(ui::AX_STATE_VISITED)) |
3358 ia_state_ |= STATE_SYSTEM_TRAVERSED; | 3358 ia_state_ |= STATE_SYSTEM_TRAVERSED; |
3359 if (!HasState(ui::AX_STATE_ENABLED)) | 3359 if (!HasState(ui::AX_STATE_ENABLED)) |
3360 ia_state_ |= STATE_SYSTEM_UNAVAILABLE; | 3360 ia_state_ |= STATE_SYSTEM_UNAVAILABLE; |
3361 if (HasState(ui::AX_STATE_VERTICAL)) { | 3361 if (HasState(ui::AX_STATE_VERTICAL)) |
3362 ia2_state_ |= IA2_STATE_VERTICAL; | 3362 ia2_state_ |= IA2_STATE_VERTICAL; |
3363 } else { | 3363 if (HasState(ui::AX_STATE_HORIZONTAL)) |
3364 ia2_state_ |= IA2_STATE_HORIZONTAL; | 3364 ia2_state_ |= IA2_STATE_HORIZONTAL; |
3365 } | |
3366 if (HasState(ui::AX_STATE_VISITED)) | 3365 if (HasState(ui::AX_STATE_VISITED)) |
3367 ia_state_ |= STATE_SYSTEM_TRAVERSED; | 3366 ia_state_ |= STATE_SYSTEM_TRAVERSED; |
3368 | 3367 |
3369 // WebKit marks everything as readonly unless it's editable text, so if it's | 3368 // WebKit marks everything as readonly unless it's editable text, so if it's |
3370 // not readonly, mark it as editable now. The final computation of the | 3369 // not readonly, mark it as editable now. The final computation of the |
3371 // READONLY state for MSAA is below, after the switch. | 3370 // READONLY state for MSAA is below, after the switch. |
3372 if (!HasState(ui::AX_STATE_READ_ONLY)) | 3371 if (!HasState(ui::AX_STATE_READ_ONLY)) |
3373 ia2_state_ |= IA2_STATE_EDITABLE; | 3372 ia2_state_ |= IA2_STATE_EDITABLE; |
3374 | 3373 |
3375 base::string16 invalid; | 3374 base::string16 invalid; |
(...skipping 473 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3849 // The role should always be set. | 3848 // The role should always be set. |
3850 DCHECK(!role_name_.empty() || ia_role_); | 3849 DCHECK(!role_name_.empty() || ia_role_); |
3851 | 3850 |
3852 // If we didn't explicitly set the IAccessible2 role, make it the same | 3851 // If we didn't explicitly set the IAccessible2 role, make it the same |
3853 // as the MSAA role. | 3852 // as the MSAA role. |
3854 if (!ia2_role_) | 3853 if (!ia2_role_) |
3855 ia2_role_ = ia_role_; | 3854 ia2_role_ = ia_role_; |
3856 } | 3855 } |
3857 | 3856 |
3858 } // namespace content | 3857 } // namespace content |
OLD | NEW |