| 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/accessibility_tree_formatter.h" | 5 #include "content/browser/accessibility/accessibility_tree_formatter.h" |
| 6 | 6 |
| 7 #include <oleacc.h> | 7 #include <oleacc.h> |
| 8 #include <stddef.h> |
| 9 #include <stdint.h> |
| 8 | 10 |
| 9 #include <string> | 11 #include <string> |
| 10 | 12 |
| 11 #include "base/files/file_path.h" | 13 #include "base/files/file_path.h" |
| 12 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
| 13 #include "base/strings/string_piece.h" | 15 #include "base/strings/string_piece.h" |
| 14 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
| 15 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/win/scoped_bstr.h" | 19 #include "base/win/scoped_bstr.h" |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 base::win::ScopedBstr temp_bstr; | 169 base::win::ScopedBstr temp_bstr; |
| 168 if (SUCCEEDED(ax_object->get_accName(variant_self, temp_bstr.Receive()))) | 170 if (SUCCEEDED(ax_object->get_accName(variant_self, temp_bstr.Receive()))) |
| 169 dict->SetString("name", base::string16(temp_bstr, temp_bstr.Length())); | 171 dict->SetString("name", base::string16(temp_bstr, temp_bstr.Length())); |
| 170 temp_bstr.Reset(); | 172 temp_bstr.Reset(); |
| 171 | 173 |
| 172 if (SUCCEEDED(ax_object->get_accValue(variant_self, temp_bstr.Receive()))) | 174 if (SUCCEEDED(ax_object->get_accValue(variant_self, temp_bstr.Receive()))) |
| 173 dict->SetString("value", base::string16(temp_bstr, temp_bstr.Length())); | 175 dict->SetString("value", base::string16(temp_bstr, temp_bstr.Length())); |
| 174 temp_bstr.Reset(); | 176 temp_bstr.Reset(); |
| 175 | 177 |
| 176 std::vector<base::string16> state_strings; | 178 std::vector<base::string16> state_strings; |
| 177 int32 ia_state = ax_object->ia_state(); | 179 int32_t ia_state = ax_object->ia_state(); |
| 178 | 180 |
| 179 // Avoid flakiness: these states depend on whether the window is focused | 181 // Avoid flakiness: these states depend on whether the window is focused |
| 180 // and the position of the mouse cursor. | 182 // and the position of the mouse cursor. |
| 181 ia_state &= ~STATE_SYSTEM_HOTTRACKED; | 183 ia_state &= ~STATE_SYSTEM_HOTTRACKED; |
| 182 ia_state &= ~STATE_SYSTEM_OFFSCREEN; | 184 ia_state &= ~STATE_SYSTEM_OFFSCREEN; |
| 183 | 185 |
| 184 IAccessibleStateToStringVector(ia_state, &state_strings); | 186 IAccessibleStateToStringVector(ia_state, &state_strings); |
| 185 IAccessible2StateToStringVector(ax_object->ia2_state(), &state_strings); | 187 IAccessible2StateToStringVector(ax_object->ia2_state(), &state_strings); |
| 186 base::ListValue* states = new base::ListValue; | 188 base::ListValue* states = new base::ListValue; |
| 187 for (const auto& state_string : state_strings) | 189 for (const auto& state_string : state_strings) |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 410 | 412 |
| 411 const std::string AccessibilityTreeFormatterWin::GetAllowString() { | 413 const std::string AccessibilityTreeFormatterWin::GetAllowString() { |
| 412 return "@WIN-ALLOW:"; | 414 return "@WIN-ALLOW:"; |
| 413 } | 415 } |
| 414 | 416 |
| 415 const std::string AccessibilityTreeFormatterWin::GetDenyString() { | 417 const std::string AccessibilityTreeFormatterWin::GetDenyString() { |
| 416 return "@WIN-DENY:"; | 418 return "@WIN-DENY:"; |
| 417 } | 419 } |
| 418 | 420 |
| 419 } // namespace content | 421 } // namespace content |
| OLD | NEW |