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 2927 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2938 if (ia_role != ROLE_SYSTEM_GRAPHIC) { | 2938 if (ia_role != ROLE_SYSTEM_GRAPHIC) { |
2939 *object = NULL; | 2939 *object = NULL; |
2940 return E_NOINTERFACE; | 2940 return E_NOINTERFACE; |
2941 } | 2941 } |
2942 } else if (iid == IID_IAccessibleTable || iid == IID_IAccessibleTable2) { | 2942 } else if (iid == IID_IAccessibleTable || iid == IID_IAccessibleTable2) { |
2943 if (ia_role != ROLE_SYSTEM_TABLE) { | 2943 if (ia_role != ROLE_SYSTEM_TABLE) { |
2944 *object = NULL; | 2944 *object = NULL; |
2945 return E_NOINTERFACE; | 2945 return E_NOINTERFACE; |
2946 } | 2946 } |
2947 } else if (iid == IID_IAccessibleTableCell) { | 2947 } else if (iid == IID_IAccessibleTableCell) { |
2948 if (!accessibility->IsCellOrTableHeaderRole()) { | 2948 if (!accessibility->IsCellOrTableHeaderRole(accessibility->GetRole())) { |
2949 *object = NULL; | 2949 *object = NULL; |
2950 return E_NOINTERFACE; | 2950 return E_NOINTERFACE; |
2951 } | 2951 } |
2952 } else if (iid == IID_IAccessibleValue) { | 2952 } else if (iid == IID_IAccessibleValue) { |
2953 if (ia_role != ROLE_SYSTEM_PROGRESSBAR && | 2953 if (ia_role != ROLE_SYSTEM_PROGRESSBAR && |
2954 ia_role != ROLE_SYSTEM_SCROLLBAR && | 2954 ia_role != ROLE_SYSTEM_SCROLLBAR && |
2955 ia_role != ROLE_SYSTEM_SLIDER) { | 2955 ia_role != ROLE_SYSTEM_SLIDER) { |
2956 *object = NULL; | 2956 *object = NULL; |
2957 return E_NOINTERFACE; | 2957 return E_NOINTERFACE; |
2958 } | 2958 } |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3026 StringAttributeToIA2(ui::AX_ATTR_CONTAINER_LIVE_STATUS, | 3026 StringAttributeToIA2(ui::AX_ATTR_CONTAINER_LIVE_STATUS, |
3027 "container-live"); | 3027 "container-live"); |
3028 StringAttributeToIA2(ui::AX_ATTR_CONTAINER_LIVE_RELEVANT, | 3028 StringAttributeToIA2(ui::AX_ATTR_CONTAINER_LIVE_RELEVANT, |
3029 "container-relevant"); | 3029 "container-relevant"); |
3030 BoolAttributeToIA2(ui::AX_ATTR_CONTAINER_LIVE_ATOMIC, | 3030 BoolAttributeToIA2(ui::AX_ATTR_CONTAINER_LIVE_ATOMIC, |
3031 "container-atomic"); | 3031 "container-atomic"); |
3032 BoolAttributeToIA2(ui::AX_ATTR_CONTAINER_LIVE_BUSY, | 3032 BoolAttributeToIA2(ui::AX_ATTR_CONTAINER_LIVE_BUSY, |
3033 "container-busy"); | 3033 "container-busy"); |
3034 | 3034 |
3035 // Expose table cell index. | 3035 // Expose table cell index. |
3036 if (IsCellOrTableHeaderRole()) { | 3036 if (IsCellOrTableHeaderRole(GetRole())) { |
3037 BrowserAccessibility* table = GetParent(); | 3037 BrowserAccessibility* table = GetParent(); |
3038 while (table && table->GetRole() != ui::AX_ROLE_TABLE) | 3038 while (table && table->GetRole() != ui::AX_ROLE_TABLE) |
3039 table = table->GetParent(); | 3039 table = table->GetParent(); |
3040 if (table) { | 3040 if (table) { |
3041 const std::vector<int32>& unique_cell_ids = table->GetIntListAttribute( | 3041 const std::vector<int32>& unique_cell_ids = table->GetIntListAttribute( |
3042 ui::AX_ATTR_UNIQUE_CELL_IDS); | 3042 ui::AX_ATTR_UNIQUE_CELL_IDS); |
3043 for (size_t i = 0; i < unique_cell_ids.size(); ++i) { | 3043 for (size_t i = 0; i < unique_cell_ids.size(); ++i) { |
3044 if (unique_cell_ids[i] == GetId()) { | 3044 if (unique_cell_ids[i] == GetId()) { |
3045 win_attributes_->ia2_attributes.push_back( | 3045 win_attributes_->ia2_attributes.push_back( |
3046 base::string16(L"table-cell-index:") + base::IntToString16(i)); | 3046 base::string16(L"table-cell-index:") + base::IntToString16(i)); |
(...skipping 1085 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4132 ia2_role = ia_role; | 4132 ia2_role = ia_role; |
4133 | 4133 |
4134 win_attributes_->ia_role = ia_role; | 4134 win_attributes_->ia_role = ia_role; |
4135 win_attributes_->ia_state = ia_state; | 4135 win_attributes_->ia_state = ia_state; |
4136 win_attributes_->role_name = role_name; | 4136 win_attributes_->role_name = role_name; |
4137 win_attributes_->ia2_role = ia2_role; | 4137 win_attributes_->ia2_role = ia2_role; |
4138 win_attributes_->ia2_state = ia2_state; | 4138 win_attributes_->ia2_state = ia2_state; |
4139 } | 4139 } |
4140 | 4140 |
4141 } // namespace content | 4141 } // namespace content |
OLD | NEW |