| OLD | NEW |
| 1 // Copyright (c) 2017 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2017 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_com_win.h" | 5 #include "content/browser/accessibility/browser_accessibility_com_win.h" |
| 6 | 6 |
| 7 #include <UIAutomationClient.h> | 7 #include <UIAutomationClient.h> |
| 8 #include <UIAutomationCoreApi.h> | 8 #include <UIAutomationCoreApi.h> |
| 9 | 9 |
| 10 #include <algorithm> | 10 #include <algorithm> |
| (...skipping 5273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5284 break; | 5284 break; |
| 5285 case ui::AX_ROLE_CONTENT_INFO: | 5285 case ui::AX_ROLE_CONTENT_INFO: |
| 5286 ia_role = ROLE_SYSTEM_TEXT; | 5286 ia_role = ROLE_SYSTEM_TEXT; |
| 5287 ia2_role = IA2_ROLE_PARAGRAPH; | 5287 ia2_role = IA2_ROLE_PARAGRAPH; |
| 5288 break; | 5288 break; |
| 5289 case ui::AX_ROLE_DATE: | 5289 case ui::AX_ROLE_DATE: |
| 5290 case ui::AX_ROLE_DATE_TIME: | 5290 case ui::AX_ROLE_DATE_TIME: |
| 5291 ia_role = ROLE_SYSTEM_DROPLIST; | 5291 ia_role = ROLE_SYSTEM_DROPLIST; |
| 5292 ia2_role = IA2_ROLE_DATE_EDITOR; | 5292 ia2_role = IA2_ROLE_DATE_EDITOR; |
| 5293 break; | 5293 break; |
| 5294 case ui::AX_ROLE_DIV: | |
| 5295 role_name = L"div"; | |
| 5296 ia_role = ROLE_SYSTEM_GROUPING; | |
| 5297 ia2_role = IA2_ROLE_SECTION; | |
| 5298 break; | |
| 5299 case ui::AX_ROLE_DEFINITION: | 5294 case ui::AX_ROLE_DEFINITION: |
| 5300 role_name = html_tag; | 5295 role_name = html_tag; |
| 5301 ia2_role = IA2_ROLE_PARAGRAPH; | 5296 ia2_role = IA2_ROLE_PARAGRAPH; |
| 5302 ia_state |= STATE_SYSTEM_READONLY; | 5297 ia_state |= STATE_SYSTEM_READONLY; |
| 5303 break; | 5298 break; |
| 5304 case ui::AX_ROLE_DESCRIPTION_LIST_DETAIL: | 5299 case ui::AX_ROLE_DESCRIPTION_LIST_DETAIL: |
| 5305 role_name = html_tag; | 5300 role_name = html_tag; |
| 5306 ia_role = ROLE_SYSTEM_TEXT; | 5301 ia_role = ROLE_SYSTEM_TEXT; |
| 5307 ia2_role = IA2_ROLE_PARAGRAPH; | 5302 ia2_role = IA2_ROLE_PARAGRAPH; |
| 5308 break; | 5303 break; |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5354 ia_role = ROLE_SYSTEM_GROUPING; | 5349 ia_role = ROLE_SYSTEM_GROUPING; |
| 5355 break; | 5350 break; |
| 5356 case ui::AX_ROLE_FORM: | 5351 case ui::AX_ROLE_FORM: |
| 5357 role_name = L"form"; | 5352 role_name = L"form"; |
| 5358 ia2_role = IA2_ROLE_FORM; | 5353 ia2_role = IA2_ROLE_FORM; |
| 5359 break; | 5354 break; |
| 5360 case ui::AX_ROLE_FOOTER: | 5355 case ui::AX_ROLE_FOOTER: |
| 5361 ia_role = ROLE_SYSTEM_GROUPING; | 5356 ia_role = ROLE_SYSTEM_GROUPING; |
| 5362 ia2_role = IA2_ROLE_FOOTER; | 5357 ia2_role = IA2_ROLE_FOOTER; |
| 5363 break; | 5358 break; |
| 5359 case ui::AX_ROLE_GENERIC_CONTAINER: |
| 5360 ia_role = ROLE_SYSTEM_GROUPING; |
| 5361 ia2_role = IA2_ROLE_SECTION; |
| 5362 role_name = html_tag.empty() ? L"div" : html_tag; |
| 5363 break; |
| 5364 case ui::AX_ROLE_GRID: | 5364 case ui::AX_ROLE_GRID: |
| 5365 ia_role = ROLE_SYSTEM_TABLE; | 5365 ia_role = ROLE_SYSTEM_TABLE; |
| 5366 // TODO(aleventhal) this changed between ARIA 1.0 and 1.1, | 5366 // TODO(aleventhal) this changed between ARIA 1.0 and 1.1, |
| 5367 // need to determine whether grids/treegrids should really be readonly | 5367 // need to determine whether grids/treegrids should really be readonly |
| 5368 // or editable by default | 5368 // or editable by default |
| 5369 // ia_state |= STATE_SYSTEM_READONLY; | 5369 // ia_state |= STATE_SYSTEM_READONLY; |
| 5370 break; | 5370 break; |
| 5371 case ui::AX_ROLE_GROUP: { | 5371 case ui::AX_ROLE_GROUP: |
| 5372 base::string16 aria_role = | 5372 ia_role = ROLE_SYSTEM_GROUPING; |
| 5373 owner()->GetString16Attribute(ui::AX_ATTR_ROLE); | |
| 5374 if (aria_role == L"group" || html_tag == L"fieldset") { | |
| 5375 ia_role = ROLE_SYSTEM_GROUPING; | |
| 5376 } else if (html_tag == L"li") { | |
| 5377 ia_role = ROLE_SYSTEM_LISTITEM; | |
| 5378 ia_state |= STATE_SYSTEM_READONLY; | |
| 5379 } else { | |
| 5380 if (html_tag.empty()) | |
| 5381 role_name = L"div"; | |
| 5382 else | |
| 5383 role_name = html_tag; | |
| 5384 ia2_role = IA2_ROLE_SECTION; | |
| 5385 } | |
| 5386 break; | 5373 break; |
| 5387 } | |
| 5388 case ui::AX_ROLE_HEADING: | 5374 case ui::AX_ROLE_HEADING: |
| 5389 role_name = html_tag; | 5375 role_name = html_tag; |
| 5390 if (html_tag.empty()) | 5376 if (html_tag.empty()) |
| 5391 ia_role = ROLE_SYSTEM_GROUPING; | 5377 ia_role = ROLE_SYSTEM_GROUPING; |
| 5392 ia2_role = IA2_ROLE_HEADING; | 5378 ia2_role = IA2_ROLE_HEADING; |
| 5393 break; | 5379 break; |
| 5394 case ui::AX_ROLE_IFRAME: | 5380 case ui::AX_ROLE_IFRAME: |
| 5395 ia_role = ROLE_SYSTEM_DOCUMENT; | 5381 ia_role = ROLE_SYSTEM_DOCUMENT; |
| 5396 ia2_role = IA2_ROLE_INTERNAL_FRAME; | 5382 ia2_role = IA2_ROLE_INTERNAL_FRAME; |
| 5397 ia_state = STATE_SYSTEM_READONLY; | 5383 ia_state = STATE_SYSTEM_READONLY; |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5728 | 5714 |
| 5729 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( | 5715 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( |
| 5730 BrowserAccessibility* obj) { | 5716 BrowserAccessibility* obj) { |
| 5731 if (!obj || !obj->IsNative()) | 5717 if (!obj || !obj->IsNative()) |
| 5732 return nullptr; | 5718 return nullptr; |
| 5733 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); | 5719 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); |
| 5734 return result; | 5720 return result; |
| 5735 } | 5721 } |
| 5736 | 5722 |
| 5737 } // namespace content | 5723 } // namespace content |
| OLD | NEW |