Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(151)

Side by Side Diff: content/browser/accessibility/browser_accessibility_win.cc

Issue 656293002: Fix MSAA+IA2 & AX for <header> tag and banner role (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 3379 matching lines...) Expand 10 before | Expand all | Expand 10 after
3390 case ui::AX_ROLE_ALERT_DIALOG: 3390 case ui::AX_ROLE_ALERT_DIALOG:
3391 ia_role_ = ROLE_SYSTEM_DIALOG; 3391 ia_role_ = ROLE_SYSTEM_DIALOG;
3392 break; 3392 break;
3393 case ui::AX_ROLE_APPLICATION: 3393 case ui::AX_ROLE_APPLICATION:
3394 ia_role_ = ROLE_SYSTEM_APPLICATION; 3394 ia_role_ = ROLE_SYSTEM_APPLICATION;
3395 break; 3395 break;
3396 case ui::AX_ROLE_ARTICLE: 3396 case ui::AX_ROLE_ARTICLE:
3397 ia_role_ = ROLE_SYSTEM_DOCUMENT; 3397 ia_role_ = ROLE_SYSTEM_DOCUMENT;
3398 ia_state_ |= STATE_SYSTEM_READONLY; 3398 ia_state_ |= STATE_SYSTEM_READONLY;
3399 break; 3399 break;
3400 case ui::AX_ROLE_BANNER:
3401 ia_role_ = ROLE_SYSTEM_GROUPING;
3402 ia2_role_ = IA2_ROLE_HEADER;
3403 break;
3400 case ui::AX_ROLE_BUSY_INDICATOR: 3404 case ui::AX_ROLE_BUSY_INDICATOR:
3401 ia_role_ = ROLE_SYSTEM_ANIMATION; 3405 ia_role_ = ROLE_SYSTEM_ANIMATION;
3402 ia_state_ |= STATE_SYSTEM_READONLY; 3406 ia_state_ |= STATE_SYSTEM_READONLY;
3403 break; 3407 break;
3404 case ui::AX_ROLE_BUTTON: 3408 case ui::AX_ROLE_BUTTON:
3405 ia_role_ = ROLE_SYSTEM_PUSHBUTTON; 3409 ia_role_ = ROLE_SYSTEM_PUSHBUTTON;
3406 bool is_aria_pressed_defined; 3410 bool is_aria_pressed_defined;
3407 bool is_mixed; 3411 bool is_mixed;
3408 if (GetAriaTristate("aria-pressed", &is_aria_pressed_defined, &is_mixed)) 3412 if (GetAriaTristate("aria-pressed", &is_aria_pressed_defined, &is_mixed))
3409 ia_state_ |= STATE_SYSTEM_PRESSED; 3413 ia_state_ |= STATE_SYSTEM_PRESSED;
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
3568 break; 3572 break;
3569 case ui::AX_ROLE_IMAGE_MAP_LINK: 3573 case ui::AX_ROLE_IMAGE_MAP_LINK:
3570 ia_role_ = ROLE_SYSTEM_LINK; 3574 ia_role_ = ROLE_SYSTEM_LINK;
3571 ia_state_ |= STATE_SYSTEM_LINKED; 3575 ia_state_ |= STATE_SYSTEM_LINKED;
3572 ia_state_ |= STATE_SYSTEM_READONLY; 3576 ia_state_ |= STATE_SYSTEM_READONLY;
3573 break; 3577 break;
3574 case ui::AX_ROLE_LABEL_TEXT: 3578 case ui::AX_ROLE_LABEL_TEXT:
3575 ia_role_ = ROLE_SYSTEM_TEXT; 3579 ia_role_ = ROLE_SYSTEM_TEXT;
3576 ia2_role_ = IA2_ROLE_LABEL; 3580 ia2_role_ = IA2_ROLE_LABEL;
3577 break; 3581 break;
3578 case ui::AX_ROLE_BANNER:
3579 case ui::AX_ROLE_SEARCH: 3582 case ui::AX_ROLE_SEARCH:
3580 ia_role_ = ROLE_SYSTEM_GROUPING; 3583 ia_role_ = ROLE_SYSTEM_GROUPING;
3581 ia2_role_ = IA2_ROLE_SECTION; 3584 ia2_role_ = IA2_ROLE_SECTION;
3582 ia_state_ |= STATE_SYSTEM_READONLY; 3585 ia_state_ |= STATE_SYSTEM_READONLY;
3583 break; 3586 break;
3584 case ui::AX_ROLE_LINK: 3587 case ui::AX_ROLE_LINK:
3585 ia_role_ = ROLE_SYSTEM_LINK; 3588 ia_role_ = ROLE_SYSTEM_LINK;
3586 ia_state_ |= STATE_SYSTEM_LINKED; 3589 ia_state_ |= STATE_SYSTEM_LINKED;
3587 break; 3590 break;
3588 case ui::AX_ROLE_LIST: 3591 case ui::AX_ROLE_LIST:
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after
3847 // The role should always be set. 3850 // The role should always be set.
3848 DCHECK(!role_name_.empty() || ia_role_); 3851 DCHECK(!role_name_.empty() || ia_role_);
3849 3852
3850 // If we didn't explicitly set the IAccessible2 role, make it the same 3853 // If we didn't explicitly set the IAccessible2 role, make it the same
3851 // as the MSAA role. 3854 // as the MSAA role.
3852 if (!ia2_role_) 3855 if (!ia2_role_)
3853 ia2_role_ = ia_role_; 3856 ia2_role_ = ia_role_;
3854 } 3857 }
3855 3858
3856 } // namespace content 3859 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698