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> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 "similar_items_in_group", | 77 "similar_items_in_group", |
78 "position_in_group", | 78 "position_in_group", |
79 "table_rows", | 79 "table_rows", |
80 "table_columns", | 80 "table_columns", |
81 "row_index", | 81 "row_index", |
82 "column_index", | 82 "column_index", |
83 "n_characters", | 83 "n_characters", |
84 "caret_offset", | 84 "caret_offset", |
85 "n_selections", | 85 "n_selections", |
86 "selection_start", | 86 "selection_start", |
87 "selection_end" | 87 "selection_end", |
| 88 "localized_extended_role", |
88 }; | 89 }; |
89 | 90 |
90 namespace { | 91 namespace { |
91 | 92 |
92 base::string16 GetIA2Hypertext(BrowserAccessibilityWin& ax_object) { | 93 base::string16 GetIA2Hypertext(BrowserAccessibilityWin& ax_object) { |
93 base::win::ScopedBstr text_bstr; | 94 base::win::ScopedBstr text_bstr; |
94 HRESULT hr; | 95 HRESULT hr; |
95 | 96 |
96 hr = ax_object.get_text(0, IA2_TEXT_OFFSET_LENGTH, text_bstr.Receive()); | 97 hr = ax_object.get_text(0, IA2_TEXT_OFFSET_LENGTH, text_bstr.Receive()); |
97 if (FAILED(hr)) | 98 if (FAILED(hr)) |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 if (SUCCEEDED(ax_object->get_nSelections(&n_selections))) { | 321 if (SUCCEEDED(ax_object->get_nSelections(&n_selections))) { |
321 dict->SetInteger("n_selections", n_selections); | 322 dict->SetInteger("n_selections", n_selections); |
322 if (n_selections > 0) { | 323 if (n_selections > 0) { |
323 LONG start, end; | 324 LONG start, end; |
324 if (SUCCEEDED(ax_object->get_selection(0, &start, &end))) { | 325 if (SUCCEEDED(ax_object->get_selection(0, &start, &end))) { |
325 dict->SetInteger("selection_start", start); | 326 dict->SetInteger("selection_start", start); |
326 dict->SetInteger("selection_end", end); | 327 dict->SetInteger("selection_end", end); |
327 } | 328 } |
328 } | 329 } |
329 } | 330 } |
| 331 |
| 332 if (SUCCEEDED(ax_object->get_localizedExtendedRole(temp_bstr.Receive()))) { |
| 333 dict->SetString("localized_extended_role", base::string16(temp_bstr, |
| 334 temp_bstr.Length())); |
| 335 } |
| 336 temp_bstr.Reset(); |
330 } | 337 } |
331 | 338 |
332 base::string16 AccessibilityTreeFormatterWin::ToString( | 339 base::string16 AccessibilityTreeFormatterWin::ToString( |
333 const base::DictionaryValue& dict) { | 340 const base::DictionaryValue& dict) { |
334 base::string16 line; | 341 base::string16 line; |
335 | 342 |
336 if (show_ids()) { | 343 if (show_ids()) { |
337 int id_value; | 344 int id_value; |
338 dict.GetInteger("id", &id_value); | 345 dict.GetInteger("id", &id_value); |
339 WriteAttribute(true, base::IntToString16(id_value), &line); | 346 WriteAttribute(true, base::IntToString16(id_value), &line); |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 | 439 |
433 const std::string AccessibilityTreeFormatterWin::GetAllowString() { | 440 const std::string AccessibilityTreeFormatterWin::GetAllowString() { |
434 return "@WIN-ALLOW:"; | 441 return "@WIN-ALLOW:"; |
435 } | 442 } |
436 | 443 |
437 const std::string AccessibilityTreeFormatterWin::GetDenyString() { | 444 const std::string AccessibilityTreeFormatterWin::GetDenyString() { |
438 return "@WIN-DENY:"; | 445 return "@WIN-DENY:"; |
439 } | 446 } |
440 | 447 |
441 } // namespace content | 448 } // namespace content |
OLD | NEW |