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

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

Issue 1063383005: Chromium side Implementation to expose aria properties - setsize & posinset (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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 875 matching lines...) Expand 10 before | Expand all | Expand 10 after
886 } else { 886 } else {
887 return E_INVALIDARG; 887 return E_INVALIDARG;
888 } 888 }
889 889
890 manager()->ScrollToPoint(*this, scroll_to); 890 manager()->ScrollToPoint(*this, scroll_to);
891 manager()->ToBrowserAccessibilityManagerWin()->TrackScrollingObject(this); 891 manager()->ToBrowserAccessibilityManagerWin()->TrackScrollingObject(this);
892 892
893 return S_OK; 893 return S_OK;
894 } 894 }
895 895
896 STDMETHODIMP BrowserAccessibilityWin::get_groupPosition( 896 STDMETHODIMP BrowserAccessibilityWin::get_groupPosition(
dmazzoni 2015/04/09 06:31:22 aria-posinset should also be exposed here.
897 LONG* group_level, 897 LONG* group_level,
898 LONG* similar_items_in_group, 898 LONG* similar_items_in_group,
899 LONG* position_in_group) { 899 LONG* position_in_group) {
900 if (!instance_active()) 900 if (!instance_active())
901 return E_FAIL; 901 return E_FAIL;
902 902
903 if (!group_level || !similar_items_in_group || !position_in_group) 903 if (!group_level || !similar_items_in_group || !position_in_group)
904 return E_INVALIDARG; 904 return E_INVALIDARG;
905 905
906 if (GetRole() == ui::AX_ROLE_LIST_BOX_OPTION && 906 if (GetRole() == ui::AX_ROLE_LIST_BOX_OPTION &&
(...skipping 2092 matching lines...) Expand 10 before | Expand all | Expand 10 after
2999 StringAttributeToIA2(ui::AX_ATTR_HTML_TAG, "tag"); 2999 StringAttributeToIA2(ui::AX_ATTR_HTML_TAG, "tag");
3000 StringAttributeToIA2(ui::AX_ATTR_ROLE, "xml-roles"); 3000 StringAttributeToIA2(ui::AX_ATTR_ROLE, "xml-roles");
3001 3001
3002 // Expose "level" attribute for headings, trees, etc. 3002 // Expose "level" attribute for headings, trees, etc.
3003 IntAttributeToIA2(ui::AX_ATTR_HIERARCHICAL_LEVEL, "level"); 3003 IntAttributeToIA2(ui::AX_ATTR_HIERARCHICAL_LEVEL, "level");
3004 3004
3005 // Expose the set size and position in set for listbox options. 3005 // Expose the set size and position in set for listbox options.
3006 if (GetRole() == ui::AX_ROLE_LIST_BOX_OPTION && 3006 if (GetRole() == ui::AX_ROLE_LIST_BOX_OPTION &&
3007 GetParent() && 3007 GetParent() &&
3008 GetParent()->GetRole() == ui::AX_ROLE_LIST_BOX) { 3008 GetParent()->GetRole() == ui::AX_ROLE_LIST_BOX) {
3009 win_attributes_->ia2_attributes.push_back( 3009 if (HasIntAttribute(ui::AX_ATTR_SET_SIZE)){
3010 L"setsize:" + base::IntToString16(GetParent()->PlatformChildCount())); 3010 IntAttributeToIA2(ui::AX_ATTR_SET_SIZE, "setsize");
3011 win_attributes_->ia2_attributes.push_back( 3011 } else {
3012 L"setsize:" + base::IntToString16(GetIndexInParent() + 1)); 3012 win_attributes_->ia2_attributes.push_back(
3013 L"setsize:" + base::IntToString16(GetParent()->PlatformChildCount()));
dmazzoni 2015/04/09 06:31:22 I think it'd be nicer if this logic was all done i
3014 }
3015
3016 if (HasIntAttribute(ui::AX_ATTR_POS_IN_SET)){
3017 IntAttributeToIA2(ui::AX_ATTR_POS_IN_SET, "posinset");
3018 } else {
3019 win_attributes_->ia2_attributes.push_back(
3020 L"posinset:" + base::IntToString16(GetIndexInParent() + 1));
3021 }
3013 } 3022 }
3014 3023
3015 if (ia_role() == ROLE_SYSTEM_CHECKBUTTON || 3024 if (ia_role() == ROLE_SYSTEM_CHECKBUTTON ||
3016 ia_role() == ROLE_SYSTEM_RADIOBUTTON || 3025 ia_role() == ROLE_SYSTEM_RADIOBUTTON ||
3017 ia2_role() == IA2_ROLE_CHECK_MENU_ITEM || 3026 ia2_role() == IA2_ROLE_CHECK_MENU_ITEM ||
3018 ia2_role() == IA2_ROLE_RADIO_MENU_ITEM || 3027 ia2_role() == IA2_ROLE_RADIO_MENU_ITEM ||
3019 ia2_role() == IA2_ROLE_TOGGLE_BUTTON) { 3028 ia2_role() == IA2_ROLE_TOGGLE_BUTTON) {
3020 win_attributes_->ia2_attributes.push_back(L"checkable:true"); 3029 win_attributes_->ia2_attributes.push_back(L"checkable:true");
3021 } 3030 }
3022 3031
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after
4144 ia2_role = ia_role; 4153 ia2_role = ia_role;
4145 4154
4146 win_attributes_->ia_role = ia_role; 4155 win_attributes_->ia_role = ia_role;
4147 win_attributes_->ia_state = ia_state; 4156 win_attributes_->ia_state = ia_state;
4148 win_attributes_->role_name = role_name; 4157 win_attributes_->role_name = role_name;
4149 win_attributes_->ia2_role = ia2_role; 4158 win_attributes_->ia2_role = ia2_role;
4150 win_attributes_->ia2_state = ia2_state; 4159 win_attributes_->ia2_state = ia2_state;
4151 } 4160 }
4152 4161
4153 } // namespace content 4162 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698