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 5333 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5344 break; | 5344 break; |
5345 case ui::AX_ROLE_LIST: | 5345 case ui::AX_ROLE_LIST: |
5346 ia_role = ROLE_SYSTEM_LIST; | 5346 ia_role = ROLE_SYSTEM_LIST; |
5347 ia_state |= STATE_SYSTEM_READONLY; | 5347 ia_state |= STATE_SYSTEM_READONLY; |
5348 break; | 5348 break; |
5349 case ui::AX_ROLE_LIST_BOX: | 5349 case ui::AX_ROLE_LIST_BOX: |
5350 ia_role = ROLE_SYSTEM_LIST; | 5350 ia_role = ROLE_SYSTEM_LIST; |
5351 break; | 5351 break; |
5352 case ui::AX_ROLE_LIST_BOX_OPTION: | 5352 case ui::AX_ROLE_LIST_BOX_OPTION: |
5353 ia_role = ROLE_SYSTEM_LISTITEM; | 5353 ia_role = ROLE_SYSTEM_LISTITEM; |
5354 if (ia_state & STATE_SYSTEM_SELECTABLE) { | |
5355 ia_state |= STATE_SYSTEM_FOCUSABLE; | |
5356 } | |
5357 break; | 5354 break; |
5358 case ui::AX_ROLE_LIST_ITEM: | 5355 case ui::AX_ROLE_LIST_ITEM: |
5359 ia_role = ROLE_SYSTEM_LISTITEM; | 5356 ia_role = ROLE_SYSTEM_LISTITEM; |
5360 ia_state |= STATE_SYSTEM_READONLY; | 5357 ia_state |= STATE_SYSTEM_READONLY; |
5361 break; | 5358 break; |
5362 case ui::AX_ROLE_MAIN: | 5359 case ui::AX_ROLE_MAIN: |
5363 ia_role = ROLE_SYSTEM_GROUPING; | 5360 ia_role = ROLE_SYSTEM_GROUPING; |
5364 ia2_role = IA2_ROLE_PARAGRAPH; | 5361 ia2_role = IA2_ROLE_PARAGRAPH; |
5365 break; | 5362 break; |
5366 case ui::AX_ROLE_MARK: | 5363 case ui::AX_ROLE_MARK: |
(...skipping 25 matching lines...) Expand all Loading... |
5392 ia_role = ROLE_SYSTEM_MENUITEM; | 5389 ia_role = ROLE_SYSTEM_MENUITEM; |
5393 ia2_role = IA2_ROLE_RADIO_MENU_ITEM; | 5390 ia2_role = IA2_ROLE_RADIO_MENU_ITEM; |
5394 break; | 5391 break; |
5395 case ui::AX_ROLE_MENU_LIST_POPUP: | 5392 case ui::AX_ROLE_MENU_LIST_POPUP: |
5396 ia_role = ROLE_SYSTEM_LIST; | 5393 ia_role = ROLE_SYSTEM_LIST; |
5397 ia2_state &= ~(IA2_STATE_EDITABLE); | 5394 ia2_state &= ~(IA2_STATE_EDITABLE); |
5398 break; | 5395 break; |
5399 case ui::AX_ROLE_MENU_LIST_OPTION: | 5396 case ui::AX_ROLE_MENU_LIST_OPTION: |
5400 ia_role = ROLE_SYSTEM_LISTITEM; | 5397 ia_role = ROLE_SYSTEM_LISTITEM; |
5401 ia2_state &= ~(IA2_STATE_EDITABLE); | 5398 ia2_state &= ~(IA2_STATE_EDITABLE); |
5402 if (ia_state & STATE_SYSTEM_SELECTABLE) { | |
5403 ia_state |= STATE_SYSTEM_FOCUSABLE; | |
5404 } | |
5405 break; | 5399 break; |
5406 case ui::AX_ROLE_METER: | 5400 case ui::AX_ROLE_METER: |
5407 role_name = html_tag; | 5401 role_name = html_tag; |
5408 ia_role = ROLE_SYSTEM_PROGRESSBAR; | 5402 ia_role = ROLE_SYSTEM_PROGRESSBAR; |
5409 break; | 5403 break; |
5410 case ui::AX_ROLE_NAVIGATION: | 5404 case ui::AX_ROLE_NAVIGATION: |
5411 ia_role = ROLE_SYSTEM_GROUPING; | 5405 ia_role = ROLE_SYSTEM_GROUPING; |
5412 ia2_role = IA2_ROLE_SECTION; | 5406 ia2_role = IA2_ROLE_SECTION; |
5413 break; | 5407 break; |
5414 case ui::AX_ROLE_NOTE: | 5408 case ui::AX_ROLE_NOTE: |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5645 | 5639 |
5646 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( | 5640 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( |
5647 BrowserAccessibility* obj) { | 5641 BrowserAccessibility* obj) { |
5648 if (!obj || !obj->IsNative()) | 5642 if (!obj || !obj->IsNative()) |
5649 return nullptr; | 5643 return nullptr; |
5650 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); | 5644 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); |
5651 return result; | 5645 return result; |
5652 } | 5646 } |
5653 | 5647 |
5654 } // namespace content | 5648 } // namespace content |
OLD | NEW |