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

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

Issue 616473002: Expose IA and IA2 role and state for HTML input type attributes related to date and time. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: DISABLE AX test for input type month for WIN Platform 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 3432 matching lines...) Expand 10 before | Expand all | Expand 10 after
3443 ia_role_ = ROLE_SYSTEM_COMBOBOX; 3443 ia_role_ = ROLE_SYSTEM_COMBOBOX;
3444 break; 3444 break;
3445 case ui::AX_ROLE_COMPLEMENTARY: 3445 case ui::AX_ROLE_COMPLEMENTARY:
3446 ia_role_ = ROLE_SYSTEM_GROUPING; 3446 ia_role_ = ROLE_SYSTEM_GROUPING;
3447 ia2_role_ = IA2_ROLE_NOTE; 3447 ia2_role_ = IA2_ROLE_NOTE;
3448 break; 3448 break;
3449 case ui::AX_ROLE_CONTENT_INFO: 3449 case ui::AX_ROLE_CONTENT_INFO:
3450 ia_role_ = ROLE_SYSTEM_TEXT; 3450 ia_role_ = ROLE_SYSTEM_TEXT;
3451 ia2_role_ = IA2_ROLE_PARAGRAPH; 3451 ia2_role_ = IA2_ROLE_PARAGRAPH;
3452 break; 3452 break;
3453 case ui::AX_ROLE_DATE:
3454 ia_role_ = ROLE_SYSTEM_DROPLIST;
3455 ia2_role_ = IA2_ROLE_DATE_EDITOR;
3456 break;
3457 case ui::AX_ROLE_DATE_TIME:
3458 ia_role_ = ROLE_SYSTEM_DROPLIST;
3459 ia2_role_ = IA2_ROLE_DATE_EDITOR;
3460 break;
3453 case ui::AX_ROLE_DIV: 3461 case ui::AX_ROLE_DIV:
3454 role_name_ = L"div"; 3462 role_name_ = L"div";
3455 ia2_role_ = IA2_ROLE_SECTION; 3463 ia2_role_ = IA2_ROLE_SECTION;
3456 break; 3464 break;
3457 case ui::AX_ROLE_DEFINITION: 3465 case ui::AX_ROLE_DEFINITION:
3458 role_name_ = html_tag; 3466 role_name_ = html_tag;
3459 ia2_role_ = IA2_ROLE_PARAGRAPH; 3467 ia2_role_ = IA2_ROLE_PARAGRAPH;
3460 ia_state_ |= STATE_SYSTEM_READONLY; 3468 ia_state_ |= STATE_SYSTEM_READONLY;
3461 break; 3469 break;
3462 case ui::AX_ROLE_DESCRIPTION_LIST_DETAIL: 3470 case ui::AX_ROLE_DESCRIPTION_LIST_DETAIL:
(...skipping 298 matching lines...) Expand 10 before | Expand all | Expand 10 after
3761 ia2_state_ |= IA2_STATE_MULTI_LINE; 3769 ia2_state_ |= IA2_STATE_MULTI_LINE;
3762 ia2_state_ |= IA2_STATE_EDITABLE; 3770 ia2_state_ |= IA2_STATE_EDITABLE;
3763 ia2_state_ |= IA2_STATE_SELECTABLE_TEXT; 3771 ia2_state_ |= IA2_STATE_SELECTABLE_TEXT;
3764 break; 3772 break;
3765 case ui::AX_ROLE_TEXT_FIELD: 3773 case ui::AX_ROLE_TEXT_FIELD:
3766 ia_role_ = ROLE_SYSTEM_TEXT; 3774 ia_role_ = ROLE_SYSTEM_TEXT;
3767 ia2_state_ |= IA2_STATE_SINGLE_LINE; 3775 ia2_state_ |= IA2_STATE_SINGLE_LINE;
3768 ia2_state_ |= IA2_STATE_EDITABLE; 3776 ia2_state_ |= IA2_STATE_EDITABLE;
3769 ia2_state_ |= IA2_STATE_SELECTABLE_TEXT; 3777 ia2_state_ |= IA2_STATE_SELECTABLE_TEXT;
3770 break; 3778 break;
3779 case ui::AX_ROLE_TIME:
3780 ia_role_ = ROLE_SYSTEM_SPINBUTTON;
3781 break;
3771 case ui::AX_ROLE_TIMER: 3782 case ui::AX_ROLE_TIMER:
3772 ia_role_ = ROLE_SYSTEM_CLOCK; 3783 ia_role_ = ROLE_SYSTEM_CLOCK;
3773 ia_state_ |= STATE_SYSTEM_READONLY; 3784 ia_state_ |= STATE_SYSTEM_READONLY;
3774 break; 3785 break;
3775 case ui::AX_ROLE_TOOLBAR: 3786 case ui::AX_ROLE_TOOLBAR:
3776 ia_role_ = ROLE_SYSTEM_TOOLBAR; 3787 ia_role_ = ROLE_SYSTEM_TOOLBAR;
3777 ia_state_ |= STATE_SYSTEM_READONLY; 3788 ia_state_ |= STATE_SYSTEM_READONLY;
3778 break; 3789 break;
3779 case ui::AX_ROLE_TOOLTIP: 3790 case ui::AX_ROLE_TOOLTIP:
3780 ia_role_ = ROLE_SYSTEM_TOOLTIP; 3791 ia_role_ = ROLE_SYSTEM_TOOLTIP;
(...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after
3835 // The role should always be set. 3846 // The role should always be set.
3836 DCHECK(!role_name_.empty() || ia_role_); 3847 DCHECK(!role_name_.empty() || ia_role_);
3837 3848
3838 // If we didn't explicitly set the IAccessible2 role, make it the same 3849 // If we didn't explicitly set the IAccessible2 role, make it the same
3839 // as the MSAA role. 3850 // as the MSAA role.
3840 if (!ia2_role_) 3851 if (!ia2_role_)
3841 ia2_role_ = ia_role_; 3852 ia2_role_ = ia_role_;
3842 } 3853 }
3843 3854
3844 } // namespace content 3855 } // namespace content
OLDNEW
« no previous file with comments | « chrome/common/extensions/api/automation.idl ('k') | content/browser/accessibility/dump_accessibility_tree_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698