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

Side by Side Diff: ui/accessibility/platform/ax_platform_node_win.cc

Issue 2707263011: Test aria-pressed=mixed on windows (Closed)
Patch Set: git cl try Created 3 years, 6 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 <atlbase.h> 5 #include <atlbase.h>
6 #include <atlcom.h> 6 #include <atlcom.h>
7 #include <limits.h> 7 #include <limits.h>
8 #include <oleacc.h> 8 #include <oleacc.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 1107 matching lines...) Expand 10 before | Expand all | Expand 10 after
1118 if (state & (1 << ui::AX_STATE_HOVERED)) 1118 if (state & (1 << ui::AX_STATE_HOVERED))
1119 msaa_state |= STATE_SYSTEM_HOTTRACKED; 1119 msaa_state |= STATE_SYSTEM_HOTTRACKED;
1120 if (state & (1 << ui::AX_STATE_INVISIBLE) || 1120 if (state & (1 << ui::AX_STATE_INVISIBLE) ||
1121 GetData().role == ui::AX_ROLE_IGNORED) { 1121 GetData().role == ui::AX_ROLE_IGNORED) {
1122 msaa_state |= STATE_SYSTEM_INVISIBLE; 1122 msaa_state |= STATE_SYSTEM_INVISIBLE;
1123 } 1123 }
1124 if (state & (1 << ui::AX_STATE_LINKED)) 1124 if (state & (1 << ui::AX_STATE_LINKED))
1125 msaa_state |= STATE_SYSTEM_LINKED; 1125 msaa_state |= STATE_SYSTEM_LINKED;
1126 if (state & (1 << ui::AX_STATE_OFFSCREEN)) 1126 if (state & (1 << ui::AX_STATE_OFFSCREEN))
1127 msaa_state |= STATE_SYSTEM_OFFSCREEN; 1127 msaa_state |= STATE_SYSTEM_OFFSCREEN;
1128 if (state & (1 << ui::AX_STATE_PRESSED))
1129 msaa_state |= STATE_SYSTEM_PRESSED;
1130 if (state & (1 << ui::AX_STATE_PROTECTED)) 1128 if (state & (1 << ui::AX_STATE_PROTECTED))
1131 msaa_state |= STATE_SYSTEM_PROTECTED; 1129 msaa_state |= STATE_SYSTEM_PROTECTED;
1132 if (state & (1 << ui::AX_STATE_READ_ONLY)) 1130 if (state & (1 << ui::AX_STATE_READ_ONLY))
1133 msaa_state |= STATE_SYSTEM_READONLY; 1131 msaa_state |= STATE_SYSTEM_READONLY;
1134 if (state & (1 << ui::AX_STATE_SELECTABLE)) 1132 if (state & (1 << ui::AX_STATE_SELECTABLE))
1135 msaa_state |= STATE_SYSTEM_SELECTABLE; 1133 msaa_state |= STATE_SYSTEM_SELECTABLE;
1136 if (state & (1 << ui::AX_STATE_SELECTED)) 1134 if (state & (1 << ui::AX_STATE_SELECTED))
1137 msaa_state |= STATE_SYSTEM_SELECTED; 1135 msaa_state |= STATE_SYSTEM_SELECTED;
1138 if (state & (1 << ui::AX_STATE_DISABLED)) 1136 if (state & (1 << ui::AX_STATE_DISABLED))
1139 msaa_state |= STATE_SYSTEM_UNAVAILABLE; 1137 msaa_state |= STATE_SYSTEM_UNAVAILABLE;
1140 1138
1141 // Checked state 1139 // Checked state
1142 const auto checked_state = static_cast<ui::AXCheckedState>( 1140 const auto checked_state = static_cast<ui::AXButtonState>(
1143 GetIntAttribute(ui::AX_ATTR_CHECKED_STATE)); 1141 GetIntAttribute(ui::AX_ATTR_CHECKED_STATE));
1144 switch (checked_state) { 1142 switch (checked_state) {
1145 case ui::AX_CHECKED_STATE_TRUE: 1143 case ui::AX_BUTTON_STATE_TRUE:
1146 msaa_state |= STATE_SYSTEM_CHECKED; 1144 msaa_state |= STATE_SYSTEM_CHECKED;
1147 break; 1145 break;
1148 case ui::AX_CHECKED_STATE_MIXED: 1146 case ui::AX_BUTTON_STATE_MIXED:
1149 msaa_state |= STATE_SYSTEM_MIXED; 1147 msaa_state |= STATE_SYSTEM_MIXED;
1150 break; 1148 break;
1151 default: 1149 default:
1150 break;
1151 }
1152
1153 // Pressed state
1154 const auto pressed_state = static_cast<ui::AXButtonState>(
1155 GetIntAttribute(ui::AX_ATTR_PRESSED_STATE));
1156 switch (pressed_state) {
1157 case ui::AX_BUTTON_STATE_TRUE:
1158 msaa_state |= STATE_SYSTEM_CHECKED;
1159 break;
1160 case ui::AX_BUTTON_STATE_MIXED:
1161 msaa_state |= STATE_SYSTEM_MIXED;
1162 break;
1163 default:
1152 break; 1164 break;
1153 } 1165 }
1154 1166
1155 gfx::NativeViewAccessible focus = delegate_->GetFocus(); 1167 gfx::NativeViewAccessible focus = delegate_->GetFocus();
1156 if (focus == GetNativeViewAccessible()) 1168 if (focus == GetNativeViewAccessible())
1157 msaa_state |= STATE_SYSTEM_FOCUSED; 1169 msaa_state |= STATE_SYSTEM_FOCUSED;
1158 1170
1159 // On Windows, the "focus" bit should be set on certain containers, like 1171 // On Windows, the "focus" bit should be set on certain containers, like
1160 // menu bars, when visible. 1172 // menu bars, when visible.
1161 // 1173 //
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
1293 1305
1294 AXPlatformNodeBase* base = 1306 AXPlatformNodeBase* base =
1295 FromNativeViewAccessible(node->GetNativeViewAccessible()); 1307 FromNativeViewAccessible(node->GetNativeViewAccessible());
1296 if (base && !IsDescendant(base)) 1308 if (base && !IsDescendant(base))
1297 base = nullptr; 1309 base = nullptr;
1298 1310
1299 return static_cast<AXPlatformNodeWin*>(base); 1311 return static_cast<AXPlatformNodeWin*>(base);
1300 } 1312 }
1301 1313
1302 } // namespace ui 1314 } // namespace ui
OLDNEW
« no previous file with comments | « ui/accessibility/platform/ax_platform_node_auralinux.cc ('k') | ui/views/controls/button/checkbox.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698