OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/accessibility_event_recorder.h" | 5 #include "content/browser/accessibility/accessibility_event_recorder.h" |
6 | 6 |
7 #include <oleacc.h> | 7 #include <oleacc.h> |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
199 base::win::ScopedVariant role; | 199 base::win::ScopedVariant role; |
200 iaccessible->get_accRole(childid_self, role.Receive()); | 200 iaccessible->get_accRole(childid_self, role.Receive()); |
201 base::win::ScopedBstr name_bstr; | 201 base::win::ScopedBstr name_bstr; |
202 iaccessible->get_accName(childid_self, name_bstr.Receive()); | 202 iaccessible->get_accName(childid_self, name_bstr.Receive()); |
203 base::win::ScopedBstr value_bstr; | 203 base::win::ScopedBstr value_bstr; |
204 iaccessible->get_accValue(childid_self, value_bstr.Receive()); | 204 iaccessible->get_accValue(childid_self, value_bstr.Receive()); |
205 base::win::ScopedVariant state; | 205 base::win::ScopedVariant state; |
206 iaccessible->get_accState(childid_self, state.Receive()); | 206 iaccessible->get_accState(childid_self, state.Receive()); |
207 int ia_state = V_I4(state.ptr()); | 207 int ia_state = V_I4(state.ptr()); |
208 | 208 |
| 209 // Avoid flakiness. Events fired on a WINDOW are out of the control |
| 210 // of a test. |
| 211 if (role.type() == VT_I4 && ROLE_SYSTEM_WINDOW == V_I4(role.ptr())) { |
| 212 VLOG(1) << "Ignoring event " << event << " on ROLE_SYSTEM_WINDOW"; |
| 213 return; |
| 214 } |
| 215 |
209 // Avoid flakiness. The "offscreen" state depends on whether the browser | 216 // Avoid flakiness. The "offscreen" state depends on whether the browser |
210 // window is frontmost or not, and "hottracked" depends on whether the | 217 // window is frontmost or not, and "hottracked" depends on whether the |
211 // mouse cursor happens to be over the element. | 218 // mouse cursor happens to be over the element. |
212 ia_state &= (~STATE_SYSTEM_OFFSCREEN & ~STATE_SYSTEM_HOTTRACKED); | 219 ia_state &= (~STATE_SYSTEM_OFFSCREEN & ~STATE_SYSTEM_HOTTRACKED); |
213 | 220 |
214 // The "readonly" state is set on almost every node and doesn't typically | 221 // The "readonly" state is set on almost every node and doesn't typically |
215 // change, so filter it out to keep the output less verbose. | 222 // change, so filter it out to keep the output less verbose. |
216 ia_state &= ~STATE_SYSTEM_READONLY; | 223 ia_state &= ~STATE_SYSTEM_READONLY; |
217 | 224 |
218 AccessibleStates ia2_state = 0; | 225 AccessibleStates ia2_state = 0; |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 if (accessibility_hwnd != hwnd) | 283 if (accessibility_hwnd != hwnd) |
277 return E_FAIL; | 284 return E_FAIL; |
278 | 285 |
279 IAccessible* obj = manager_->GetRoot()->ToBrowserAccessibilityWin(); | 286 IAccessible* obj = manager_->GetRoot()->ToBrowserAccessibilityWin(); |
280 obj->AddRef(); | 287 obj->AddRef(); |
281 *ppv_object = obj; | 288 *ppv_object = obj; |
282 return S_OK; | 289 return S_OK; |
283 } | 290 } |
284 | 291 |
285 } // namespace content | 292 } // namespace content |
OLD | NEW |