Chromium Code Reviews| 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 328 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 339 } | 339 } |
| 340 | 340 |
| 341 STDMETHODIMP BrowserAccessibilityRelation::get_target(long target_index, | 341 STDMETHODIMP BrowserAccessibilityRelation::get_target(long target_index, |
| 342 IUnknown** target) { | 342 IUnknown** target) { |
| 343 if (!target) | 343 if (!target) |
| 344 return E_INVALIDARG; | 344 return E_INVALIDARG; |
| 345 | 345 |
| 346 if (!owner_->GetOwner()) | 346 if (!owner_->GetOwner()) |
| 347 return E_FAIL; | 347 return E_FAIL; |
| 348 | 348 |
| 349 auto* manager = owner_->GetOwner()->manager(); | 349 auto* manager = owner_->owners_manager(); |
| 350 if (!manager) | 350 if (!manager) |
| 351 return E_FAIL; | 351 return E_FAIL; |
| 352 | 352 |
| 353 if (target_index < 0 || | 353 if (target_index < 0 || |
| 354 target_index >= static_cast<long>(target_ids_.size())) { | 354 target_index >= static_cast<long>(target_ids_.size())) { |
| 355 return E_INVALIDARG; | 355 return E_INVALIDARG; |
| 356 } | 356 } |
| 357 | 357 |
| 358 BrowserAccessibility* result = manager->GetFromID(target_ids_[target_index]); | 358 BrowserAccessibility* result = manager->GetFromID(target_ids_[target_index]); |
| 359 if (!result || !result->instance_active()) | 359 if (!result || !result->instance_active()) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 423 // * There are some methods that don't touch any state such as get_toolkitName. | 423 // * There are some methods that don't touch any state such as get_toolkitName. |
| 424 // For these rare cases, you may not need to call GetOwner(). | 424 // For these rare cases, you may not need to call GetOwner(). |
| 425 // | 425 // |
| 426 | 426 |
| 427 HRESULT BrowserAccessibilityComWin::accDoDefaultAction(VARIANT var_id) { | 427 HRESULT BrowserAccessibilityComWin::accDoDefaultAction(VARIANT var_id) { |
| 428 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ACC_DO_DEFAULT_ACTION); | 428 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ACC_DO_DEFAULT_ACTION); |
| 429 | 429 |
| 430 if (!GetOwner()) | 430 if (!GetOwner()) |
| 431 return E_FAIL; | 431 return E_FAIL; |
| 432 | 432 |
| 433 auto* manager = GetOwner()->manager(); | 433 auto* manager = owners_manager(); |
| 434 if (!manager) | 434 if (!manager) |
| 435 return E_FAIL; | 435 return E_FAIL; |
| 436 | 436 |
| 437 BrowserAccessibilityComWin* target = GetTargetFromChildID(var_id); | 437 BrowserAccessibilityComWin* target = GetTargetFromChildID(var_id); |
| 438 if (!target) | 438 if (!target) |
| 439 return E_INVALIDARG; | 439 return E_INVALIDARG; |
| 440 | 440 |
| 441 // Return an error if it's not clickable. | 441 // Return an error if it's not clickable. |
| 442 if (!target->GetOwner()->HasIntAttribute(ui::AX_ATTR_ACTION)) | 442 if (!target->GetOwner()->HasIntAttribute(ui::AX_ATTR_ACTION)) |
| 443 return DISP_E_MEMBERNOTFOUND; | 443 return DISP_E_MEMBERNOTFOUND; |
| 444 | 444 |
| 445 manager->DoDefaultAction(*target->GetOwner()); | 445 manager->DoDefaultAction(*target->GetOwner()); |
| 446 return S_OK; | 446 return S_OK; |
| 447 } | 447 } |
| 448 | 448 |
| 449 STDMETHODIMP BrowserAccessibilityComWin::accHitTest(LONG x_left, | 449 STDMETHODIMP BrowserAccessibilityComWin::accHitTest(LONG x_left, |
| 450 LONG y_top, | 450 LONG y_top, |
| 451 VARIANT* child) { | 451 VARIANT* child) { |
| 452 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ACC_HIT_TEST); | 452 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ACC_HIT_TEST); |
| 453 | 453 |
| 454 if (!GetOwner()) | 454 if (!GetOwner()) |
| 455 return E_FAIL; | 455 return E_FAIL; |
| 456 | 456 |
| 457 auto* manager = GetOwner()->manager(); | 457 auto* manager = owners_manager(); |
| 458 if (!manager) | 458 if (!manager) |
| 459 return E_FAIL; | 459 return E_FAIL; |
| 460 | 460 |
| 461 if (!child) | 461 if (!child) |
| 462 return E_INVALIDARG; | 462 return E_INVALIDARG; |
| 463 | 463 |
| 464 gfx::Point point(x_left, y_top); | 464 gfx::Point point(x_left, y_top); |
| 465 if (!GetOwner()->GetScreenBoundsRect().Contains(point)) { | 465 if (!GetOwner()->GetScreenBoundsRect().Contains(point)) { |
| 466 // Return S_FALSE and VT_EMPTY when outside the object's boundaries. | 466 // Return S_FALSE and VT_EMPTY when outside the object's boundaries. |
| 467 child->vt = VT_EMPTY; | 467 child->vt = VT_EMPTY; |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 611 | 611 |
| 612 DCHECK(*desc); | 612 DCHECK(*desc); |
| 613 return S_OK; | 613 return S_OK; |
| 614 } | 614 } |
| 615 | 615 |
| 616 STDMETHODIMP BrowserAccessibilityComWin::get_accFocus(VARIANT* focus_child) { | 616 STDMETHODIMP BrowserAccessibilityComWin::get_accFocus(VARIANT* focus_child) { |
| 617 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_FOCUS); | 617 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_FOCUS); |
| 618 if (!GetOwner()) | 618 if (!GetOwner()) |
| 619 return E_FAIL; | 619 return E_FAIL; |
| 620 | 620 |
| 621 auto* manager = GetOwner()->manager(); | 621 auto* manager = owners_manager(); |
| 622 if (!manager) | 622 if (!manager) |
| 623 return E_FAIL; | 623 return E_FAIL; |
| 624 | 624 |
| 625 if (!focus_child) | 625 if (!focus_child) |
| 626 return E_INVALIDARG; | 626 return E_INVALIDARG; |
| 627 | 627 |
| 628 BrowserAccessibilityWin* focus = | 628 BrowserAccessibilityWin* focus = |
| 629 static_cast<BrowserAccessibilityWin*>(manager->GetFocus()); | 629 static_cast<BrowserAccessibilityWin*>(manager->GetFocus()); |
| 630 if (focus == GetOwner()) { | 630 if (focus == GetOwner()) { |
| 631 focus_child->vt = VT_I4; | 631 focus_child->vt = VT_I4; |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 686 return E_FAIL; | 686 return E_FAIL; |
| 687 | 687 |
| 688 if (!disp_parent) | 688 if (!disp_parent) |
| 689 return E_INVALIDARG; | 689 return E_INVALIDARG; |
| 690 | 690 |
| 691 IAccessible* parent_obj = | 691 IAccessible* parent_obj = |
| 692 ToBrowserAccessibilityComWin(GetOwner()->PlatformGetParent()); | 692 ToBrowserAccessibilityComWin(GetOwner()->PlatformGetParent()); |
| 693 if (parent_obj == NULL) { | 693 if (parent_obj == NULL) { |
| 694 // This happens if we're the root of the tree; | 694 // This happens if we're the root of the tree; |
| 695 // return the IAccessible for the window. | 695 // return the IAccessible for the window. |
| 696 parent_obj = GetOwner() | 696 parent_obj = owners_manager() |
| 697 ->manager() | |
| 698 ->ToBrowserAccessibilityManagerWin() | 697 ->ToBrowserAccessibilityManagerWin() |
| 699 ->GetParentIAccessible(); | 698 ->GetParentIAccessible(); |
| 700 // |parent| can only be NULL if the manager was created before the parent | 699 // |parent| can only be NULL if the manager was created before the parent |
| 701 // IAccessible was known and it wasn't subsequently set before a client | 700 // IAccessible was known and it wasn't subsequently set before a client |
| 702 // requested it. This has been fixed. |parent| may also be NULL during | 701 // requested it. This has been fixed. |parent| may also be NULL during |
| 703 // destruction. Possible cases where this could occur include tabs being | 702 // destruction. Possible cases where this could occur include tabs being |
| 704 // dragged to a new window, etc. | 703 // dragged to a new window, etc. |
| 705 if (!parent_obj) { | 704 if (!parent_obj) { |
| 706 DVLOG(1) << "In Function: " << __func__ | 705 DVLOG(1) << "In Function: " << __func__ |
| 707 << ". Parent IAccessible interface is NULL. Returning failure"; | 706 << ". Parent IAccessible interface is NULL. Returning failure"; |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 735 } | 734 } |
| 736 return S_OK; | 735 return S_OK; |
| 737 } | 736 } |
| 738 | 737 |
| 739 STDMETHODIMP BrowserAccessibilityComWin::get_accState(VARIANT var_id, | 738 STDMETHODIMP BrowserAccessibilityComWin::get_accState(VARIANT var_id, |
| 740 VARIANT* state) { | 739 VARIANT* state) { |
| 741 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_STATE); | 740 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_STATE); |
| 742 if (!GetOwner()) | 741 if (!GetOwner()) |
| 743 return E_FAIL; | 742 return E_FAIL; |
| 744 | 743 |
| 745 auto* manager = GetOwner()->manager(); | 744 auto* manager = owners_manager(); |
| 746 if (!manager) | 745 if (!manager) |
| 747 return E_FAIL; | 746 return E_FAIL; |
| 748 | 747 |
| 749 if (!state) | 748 if (!state) |
| 750 return E_INVALIDARG; | 749 return E_INVALIDARG; |
| 751 | 750 |
| 752 BrowserAccessibilityComWin* target = GetTargetFromChildID(var_id); | 751 BrowserAccessibilityComWin* target = GetTargetFromChildID(var_id); |
| 753 if (!target) | 752 if (!target) |
| 754 return E_INVALIDARG; | 753 return E_INVALIDARG; |
| 755 | 754 |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 861 static_cast<base::win::IUnknownImpl*>(enum_variant)); | 860 static_cast<base::win::IUnknownImpl*>(enum_variant)); |
| 862 return S_OK; | 861 return S_OK; |
| 863 } | 862 } |
| 864 | 863 |
| 865 STDMETHODIMP BrowserAccessibilityComWin::accSelect(LONG flags_sel, | 864 STDMETHODIMP BrowserAccessibilityComWin::accSelect(LONG flags_sel, |
| 866 VARIANT var_id) { | 865 VARIANT var_id) { |
| 867 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ACC_SELECT); | 866 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_ACC_SELECT); |
| 868 if (!GetOwner()) | 867 if (!GetOwner()) |
| 869 return E_FAIL; | 868 return E_FAIL; |
| 870 | 869 |
| 871 auto* manager = GetOwner()->manager(); | 870 auto* manager = owners_manager(); |
| 872 if (!manager) | 871 if (!manager) |
| 873 return E_FAIL; | 872 return E_FAIL; |
| 874 | 873 |
| 875 if (flags_sel & SELFLAG_TAKEFOCUS) { | 874 if (flags_sel & SELFLAG_TAKEFOCUS) { |
| 876 manager->SetFocus(*GetOwner()); | 875 manager->SetFocus(*GetOwner()); |
| 877 return S_OK; | 876 return S_OK; |
| 878 } | 877 } |
| 879 | 878 |
| 880 return S_FALSE; | 879 return S_FALSE; |
| 881 } | 880 } |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 956 } | 955 } |
| 957 | 956 |
| 958 STDMETHODIMP BrowserAccessibilityComWin::get_windowHandle(HWND* window_handle) { | 957 STDMETHODIMP BrowserAccessibilityComWin::get_windowHandle(HWND* window_handle) { |
| 959 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_WINDOW_HANDLE); | 958 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_WINDOW_HANDLE); |
| 960 if (!GetOwner()) | 959 if (!GetOwner()) |
| 961 return E_FAIL; | 960 return E_FAIL; |
| 962 | 961 |
| 963 if (!window_handle) | 962 if (!window_handle) |
| 964 return E_INVALIDARG; | 963 return E_INVALIDARG; |
| 965 | 964 |
| 966 *window_handle = GetOwner() | 965 *window_handle = |
| 967 ->manager() | 966 owners_manager()->ToBrowserAccessibilityManagerWin()->GetParentHWND(); |
| 968 ->ToBrowserAccessibilityManagerWin() | |
| 969 ->GetParentHWND(); | |
| 970 if (!*window_handle) | 967 if (!*window_handle) |
| 971 return E_FAIL; | 968 return E_FAIL; |
| 972 | 969 |
| 973 return S_OK; | 970 return S_OK; |
| 974 } | 971 } |
| 975 | 972 |
| 976 STDMETHODIMP BrowserAccessibilityComWin::get_indexInParent( | 973 STDMETHODIMP BrowserAccessibilityComWin::get_indexInParent( |
| 977 LONG* index_in_parent) { | 974 LONG* index_in_parent) { |
| 978 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_INDEX_IN_PARENT); | 975 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_INDEX_IN_PARENT); |
| 979 if (!GetOwner()) | 976 if (!GetOwner()) |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1043 } | 1040 } |
| 1044 | 1041 |
| 1045 return S_OK; | 1042 return S_OK; |
| 1046 } | 1043 } |
| 1047 | 1044 |
| 1048 STDMETHODIMP BrowserAccessibilityComWin::scrollTo(IA2ScrollType scroll_type) { | 1045 STDMETHODIMP BrowserAccessibilityComWin::scrollTo(IA2ScrollType scroll_type) { |
| 1049 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_IA2_SCROLL_TO); | 1046 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_IA2_SCROLL_TO); |
| 1050 if (!GetOwner()) | 1047 if (!GetOwner()) |
| 1051 return E_FAIL; | 1048 return E_FAIL; |
| 1052 | 1049 |
| 1053 auto* manager = GetOwner()->manager(); | 1050 auto* manager = owners_manager(); |
| 1054 | 1051 |
| 1055 if (!manager) | 1052 if (!manager) |
| 1056 return E_FAIL; | 1053 return E_FAIL; |
| 1057 | 1054 |
| 1058 gfx::Rect r = GetOwner()->GetFrameBoundsRect(); | 1055 gfx::Rect r = GetOwner()->GetFrameBoundsRect(); |
| 1059 switch (scroll_type) { | 1056 switch (scroll_type) { |
| 1060 case IA2_SCROLL_TYPE_TOP_LEFT: | 1057 case IA2_SCROLL_TYPE_TOP_LEFT: |
| 1061 manager->ScrollToMakeVisible(*GetOwner(), gfx::Rect(r.x(), r.y(), 0, 0)); | 1058 manager->ScrollToMakeVisible(*GetOwner(), gfx::Rect(r.x(), r.y(), 0, 0)); |
| 1062 break; | 1059 break; |
| 1063 case IA2_SCROLL_TYPE_BOTTOM_RIGHT: | 1060 case IA2_SCROLL_TYPE_BOTTOM_RIGHT: |
| (...skipping 26 matching lines...) Expand all Loading... | |
| 1090 } | 1087 } |
| 1091 | 1088 |
| 1092 STDMETHODIMP BrowserAccessibilityComWin::scrollToPoint( | 1089 STDMETHODIMP BrowserAccessibilityComWin::scrollToPoint( |
| 1093 IA2CoordinateType coordinate_type, | 1090 IA2CoordinateType coordinate_type, |
| 1094 LONG x, | 1091 LONG x, |
| 1095 LONG y) { | 1092 LONG y) { |
| 1096 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SCROLL_TO_POINT); | 1093 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SCROLL_TO_POINT); |
| 1097 if (!GetOwner()) | 1094 if (!GetOwner()) |
| 1098 return E_FAIL; | 1095 return E_FAIL; |
| 1099 | 1096 |
| 1100 auto* manager = GetOwner()->manager(); | 1097 auto* manager = owners_manager(); |
| 1101 if (!manager) | 1098 if (!manager) |
| 1102 return E_FAIL; | 1099 return E_FAIL; |
| 1103 | 1100 |
| 1104 gfx::Point scroll_to(x, y); | 1101 gfx::Point scroll_to(x, y); |
| 1105 | 1102 |
| 1106 if (coordinate_type == IA2_COORDTYPE_SCREEN_RELATIVE) { | 1103 if (coordinate_type == IA2_COORDTYPE_SCREEN_RELATIVE) { |
| 1107 scroll_to -= manager->GetViewBounds().OffsetFromOrigin(); | 1104 scroll_to -= manager->GetViewBounds().OffsetFromOrigin(); |
| 1108 } else if (coordinate_type == IA2_COORDTYPE_PARENT_RELATIVE) { | 1105 } else if (coordinate_type == IA2_COORDTYPE_PARENT_RELATIVE) { |
| 1109 if (GetOwner()->PlatformGetParent()) { | 1106 if (GetOwner()->PlatformGetParent()) { |
| 1110 scroll_to += GetOwner() | 1107 scroll_to += GetOwner() |
| (...skipping 1662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2773 | 2770 |
| 2774 STDMETHODIMP BrowserAccessibilityComWin::doAction(long action_index) { | 2771 STDMETHODIMP BrowserAccessibilityComWin::doAction(long action_index) { |
| 2775 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_DO_ACTION); | 2772 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_DO_ACTION); |
| 2776 AddAccessibilityModeFlags(kScreenReaderAndHTMLAccessibilityModes); | 2773 AddAccessibilityModeFlags(kScreenReaderAndHTMLAccessibilityModes); |
| 2777 if (!GetOwner()) | 2774 if (!GetOwner()) |
| 2778 return E_FAIL; | 2775 return E_FAIL; |
| 2779 | 2776 |
| 2780 if (!GetOwner()->HasIntAttribute(ui::AX_ATTR_ACTION) || action_index != 0) | 2777 if (!GetOwner()->HasIntAttribute(ui::AX_ATTR_ACTION) || action_index != 0) |
| 2781 return E_INVALIDARG; | 2778 return E_INVALIDARG; |
| 2782 | 2779 |
| 2783 GetOwner()->manager()->DoDefaultAction(*GetOwner()); | 2780 owners_manager()->DoDefaultAction(*GetOwner()); |
| 2784 return S_OK; | 2781 return S_OK; |
| 2785 } | 2782 } |
| 2786 | 2783 |
| 2787 STDMETHODIMP | 2784 STDMETHODIMP |
| 2788 BrowserAccessibilityComWin::get_description(long action_index, | 2785 BrowserAccessibilityComWin::get_description(long action_index, |
| 2789 BSTR* description) { | 2786 BSTR* description) { |
| 2790 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_IAACTION_GET_DESCRIPTION); | 2787 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_IAACTION_GET_DESCRIPTION); |
| 2791 AddAccessibilityModeFlags(kScreenReaderAndHTMLAccessibilityModes); | 2788 AddAccessibilityModeFlags(kScreenReaderAndHTMLAccessibilityModes); |
| 2792 return E_NOTIMPL; | 2789 return E_NOTIMPL; |
| 2793 } | 2790 } |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2933 | 2930 |
| 2934 // | 2931 // |
| 2935 // ISimpleDOMDocument methods. | 2932 // ISimpleDOMDocument methods. |
| 2936 // | 2933 // |
| 2937 | 2934 |
| 2938 STDMETHODIMP BrowserAccessibilityComWin::get_URL(BSTR* url) { | 2935 STDMETHODIMP BrowserAccessibilityComWin::get_URL(BSTR* url) { |
| 2939 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_URL); | 2936 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_URL); |
| 2940 if (!GetOwner()) | 2937 if (!GetOwner()) |
| 2941 return E_FAIL; | 2938 return E_FAIL; |
| 2942 | 2939 |
| 2943 auto* manager = GetOwner()->manager(); | 2940 auto* manager = owners_manager(); |
| 2944 if (!manager) | 2941 if (!manager) |
| 2945 return E_FAIL; | 2942 return E_FAIL; |
| 2946 | 2943 |
| 2947 if (!url) | 2944 if (!url) |
| 2948 return E_INVALIDARG; | 2945 return E_INVALIDARG; |
| 2949 | 2946 |
| 2950 if (GetOwner() != manager->GetRoot()) | 2947 if (GetOwner() != manager->GetRoot()) |
| 2951 return E_FAIL; | 2948 return E_FAIL; |
| 2952 | 2949 |
| 2953 std::string str = manager->GetTreeData().url; | 2950 std::string str = manager->GetTreeData().url; |
| 2954 if (str.empty()) | 2951 if (str.empty()) |
| 2955 return S_FALSE; | 2952 return S_FALSE; |
| 2956 | 2953 |
| 2957 *url = SysAllocString(base::UTF8ToUTF16(str).c_str()); | 2954 *url = SysAllocString(base::UTF8ToUTF16(str).c_str()); |
| 2958 DCHECK(*url); | 2955 DCHECK(*url); |
| 2959 | 2956 |
| 2960 return S_OK; | 2957 return S_OK; |
| 2961 } | 2958 } |
| 2962 | 2959 |
| 2963 STDMETHODIMP BrowserAccessibilityComWin::get_title(BSTR* title) { | 2960 STDMETHODIMP BrowserAccessibilityComWin::get_title(BSTR* title) { |
| 2964 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_TITLE); | 2961 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_TITLE); |
| 2965 if (!GetOwner()) | 2962 if (!GetOwner()) |
| 2966 return E_FAIL; | 2963 return E_FAIL; |
| 2967 | 2964 |
| 2968 auto* manager = GetOwner()->manager(); | 2965 auto* manager = owners_manager(); |
| 2969 if (!manager) | 2966 if (!manager) |
| 2970 return E_FAIL; | 2967 return E_FAIL; |
| 2971 | 2968 |
| 2972 if (!title) | 2969 if (!title) |
| 2973 return E_INVALIDARG; | 2970 return E_INVALIDARG; |
| 2974 | 2971 |
| 2975 std::string str = manager->GetTreeData().title; | 2972 std::string str = manager->GetTreeData().title; |
| 2976 if (str.empty()) | 2973 if (str.empty()) |
| 2977 return S_FALSE; | 2974 return S_FALSE; |
| 2978 | 2975 |
| 2979 *title = SysAllocString(base::UTF8ToUTF16(str).c_str()); | 2976 *title = SysAllocString(base::UTF8ToUTF16(str).c_str()); |
| 2980 DCHECK(*title); | 2977 DCHECK(*title); |
| 2981 | 2978 |
| 2982 return S_OK; | 2979 return S_OK; |
| 2983 } | 2980 } |
| 2984 | 2981 |
| 2985 STDMETHODIMP BrowserAccessibilityComWin::get_mimeType(BSTR* mime_type) { | 2982 STDMETHODIMP BrowserAccessibilityComWin::get_mimeType(BSTR* mime_type) { |
| 2986 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_MIME_TYPE); | 2983 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_MIME_TYPE); |
| 2987 if (!GetOwner()) | 2984 if (!GetOwner()) |
| 2988 return E_FAIL; | 2985 return E_FAIL; |
| 2989 | 2986 |
| 2990 auto* manager = GetOwner()->manager(); | 2987 auto* manager = owners_manager(); |
| 2991 if (!manager) | 2988 if (!manager) |
| 2992 return E_FAIL; | 2989 return E_FAIL; |
| 2993 | 2990 |
| 2994 if (!mime_type) | 2991 if (!mime_type) |
| 2995 return E_INVALIDARG; | 2992 return E_INVALIDARG; |
| 2996 | 2993 |
| 2997 std::string str = manager->GetTreeData().mimetype; | 2994 std::string str = manager->GetTreeData().mimetype; |
| 2998 if (str.empty()) | 2995 if (str.empty()) |
| 2999 return S_FALSE; | 2996 return S_FALSE; |
| 3000 | 2997 |
| 3001 *mime_type = SysAllocString(base::UTF8ToUTF16(str).c_str()); | 2998 *mime_type = SysAllocString(base::UTF8ToUTF16(str).c_str()); |
| 3002 DCHECK(*mime_type); | 2999 DCHECK(*mime_type); |
| 3003 | 3000 |
| 3004 return S_OK; | 3001 return S_OK; |
| 3005 } | 3002 } |
| 3006 | 3003 |
| 3007 STDMETHODIMP BrowserAccessibilityComWin::get_docType(BSTR* doc_type) { | 3004 STDMETHODIMP BrowserAccessibilityComWin::get_docType(BSTR* doc_type) { |
| 3008 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_DOC_TYPE); | 3005 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_DOC_TYPE); |
| 3009 if (!GetOwner()) | 3006 if (!GetOwner()) |
| 3010 return E_FAIL; | 3007 return E_FAIL; |
| 3011 | 3008 |
| 3012 auto* manager = GetOwner()->manager(); | 3009 auto* manager = owners_manager(); |
| 3013 if (!manager) | 3010 if (!manager) |
| 3014 return E_FAIL; | 3011 return E_FAIL; |
| 3015 | 3012 |
| 3016 if (!doc_type) | 3013 if (!doc_type) |
| 3017 return E_INVALIDARG; | 3014 return E_INVALIDARG; |
| 3018 | 3015 |
| 3019 std::string str = manager->GetTreeData().doctype; | 3016 std::string str = manager->GetTreeData().doctype; |
| 3020 if (str.empty()) | 3017 if (str.empty()) |
| 3021 return S_FALSE; | 3018 return S_FALSE; |
| 3022 | 3019 |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3439 | 3436 |
| 3440 STDMETHODIMP BrowserAccessibilityComWin::scrollToSubstring( | 3437 STDMETHODIMP BrowserAccessibilityComWin::scrollToSubstring( |
| 3441 unsigned int start_index, | 3438 unsigned int start_index, |
| 3442 unsigned int end_index) { | 3439 unsigned int end_index) { |
| 3443 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SCROLL_TO_SUBSTRING); | 3440 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_SCROLL_TO_SUBSTRING); |
| 3444 AddAccessibilityModeFlags(kScreenReaderAndHTMLAccessibilityModes | | 3441 AddAccessibilityModeFlags(kScreenReaderAndHTMLAccessibilityModes | |
| 3445 AccessibilityMode::kInlineTextBoxes); | 3442 AccessibilityMode::kInlineTextBoxes); |
| 3446 if (!GetOwner()) | 3443 if (!GetOwner()) |
| 3447 return E_FAIL; | 3444 return E_FAIL; |
| 3448 | 3445 |
| 3449 auto* manager = GetOwner()->manager(); | 3446 auto* manager = owners_manager(); |
| 3450 if (!manager) | 3447 if (!manager) |
| 3451 return E_FAIL; | 3448 return E_FAIL; |
| 3452 | 3449 |
| 3453 unsigned int text_length = | 3450 unsigned int text_length = |
| 3454 static_cast<unsigned int>(GetOwner()->GetText().size()); | 3451 static_cast<unsigned int>(GetOwner()->GetText().size()); |
| 3455 if (start_index > text_length || end_index > text_length || | 3452 if (start_index > text_length || end_index > text_length || |
| 3456 start_index > end_index) { | 3453 start_index > end_index) { |
| 3457 return E_INVALIDARG; | 3454 return E_INVALIDARG; |
| 3458 } | 3455 } |
| 3459 | 3456 |
| (...skipping 268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3728 | 3725 |
| 3729 win_attributes_->offset_to_text_attributes.swap(attributes_map); | 3726 win_attributes_->offset_to_text_attributes.swap(attributes_map); |
| 3730 } | 3727 } |
| 3731 | 3728 |
| 3732 // |offset| could either be a text character or a child index in case of | 3729 // |offset| could either be a text character or a child index in case of |
| 3733 // non-text objects. | 3730 // non-text objects. |
| 3734 // TODO(nektar): Remove this function once selection bugs are fixed in Blink. | 3731 // TODO(nektar): Remove this function once selection bugs are fixed in Blink. |
| 3735 AXPlatformPosition::AXPositionInstance | 3732 AXPlatformPosition::AXPositionInstance |
| 3736 BrowserAccessibilityComWin::CreatePositionForSelectionAt(int offset) const { | 3733 BrowserAccessibilityComWin::CreatePositionForSelectionAt(int offset) const { |
| 3737 if (!GetOwner()->IsNativeTextControl() && !GetOwner()->IsTextOnlyObject()) { | 3734 if (!GetOwner()->IsNativeTextControl() && !GetOwner()->IsTextOnlyObject()) { |
| 3738 auto* manager = GetOwner()->manager(); | 3735 auto* manager = owners_manager(); |
| 3739 DCHECK(manager); | 3736 DCHECK(manager); |
| 3740 const BrowserAccessibilityComWin* child = this; | 3737 const BrowserAccessibilityComWin* child = this; |
| 3741 // TODO(nektar): Make parents of text-only objects not include the text of | 3738 // TODO(nektar): Make parents of text-only objects not include the text of |
| 3742 // children in their hypertext. | 3739 // children in their hypertext. |
| 3743 for (size_t i = 0; i < GetOwner()->InternalChildCount(); ++i) { | 3740 for (size_t i = 0; i < GetOwner()->InternalChildCount(); ++i) { |
| 3744 int new_offset = offset; | 3741 int new_offset = offset; |
| 3745 child = ToBrowserAccessibilityComWin(GetOwner()->InternalGetChild(i)); | 3742 child = ToBrowserAccessibilityComWin(GetOwner()->InternalGetChild(i)); |
| 3746 DCHECK(child); | 3743 DCHECK(child); |
| 3747 if (child->GetOwner()->IsTextOnlyObject()) { | 3744 if (child->GetOwner()->IsTextOnlyObject()) { |
| 3748 new_offset -= child->GetOwner()->GetText().length(); | 3745 new_offset -= child->GetOwner()->GetText().length(); |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3915 | 3912 |
| 3916 win_attributes_->name = GetOwner()->GetString16Attribute(ui::AX_ATTR_NAME); | 3913 win_attributes_->name = GetOwner()->GetString16Attribute(ui::AX_ATTR_NAME); |
| 3917 win_attributes_->description = | 3914 win_attributes_->description = |
| 3918 GetOwner()->GetString16Attribute(ui::AX_ATTR_DESCRIPTION); | 3915 GetOwner()->GetString16Attribute(ui::AX_ATTR_DESCRIPTION); |
| 3919 StringAttributeToIA2(ui::AX_ATTR_PLACEHOLDER, "placeholder"); | 3916 StringAttributeToIA2(ui::AX_ATTR_PLACEHOLDER, "placeholder"); |
| 3920 | 3917 |
| 3921 base::string16 value = GetOwner()->GetValue(); | 3918 base::string16 value = GetOwner()->GetValue(); |
| 3922 // On Windows, the value of a document should be its url. | 3919 // On Windows, the value of a document should be its url. |
| 3923 if (GetOwner()->GetRole() == ui::AX_ROLE_ROOT_WEB_AREA || | 3920 if (GetOwner()->GetRole() == ui::AX_ROLE_ROOT_WEB_AREA || |
| 3924 GetOwner()->GetRole() == ui::AX_ROLE_WEB_AREA) { | 3921 GetOwner()->GetRole() == ui::AX_ROLE_WEB_AREA) { |
| 3925 value = base::UTF8ToUTF16(GetOwner()->manager()->GetTreeData().url); | 3922 value = base::UTF8ToUTF16(owners_manager()->GetTreeData().url); |
| 3926 } | 3923 } |
| 3927 // If this doesn't have a value and is linked then set its value to the url | 3924 // If this doesn't have a value and is linked then set its value to the url |
| 3928 // attribute. This allows screen readers to read an empty link's destination. | 3925 // attribute. This allows screen readers to read an empty link's destination. |
| 3929 if (value.empty() && (ia_state() & STATE_SYSTEM_LINKED)) | 3926 if (value.empty() && (ia_state() & STATE_SYSTEM_LINKED)) |
| 3930 value = GetOwner()->GetString16Attribute(ui::AX_ATTR_URL); | 3927 value = GetOwner()->GetString16Attribute(ui::AX_ATTR_URL); |
| 3931 win_attributes_->value = value; | 3928 win_attributes_->value = value; |
| 3932 | 3929 |
| 3933 ClearOwnRelations(); | 3930 ClearOwnRelations(); |
| 3934 AddBidirectionalRelations(IA2_RELATION_CONTROLLER_FOR, | 3931 AddBidirectionalRelations(IA2_RELATION_CONTROLLER_FOR, |
| 3935 IA2_RELATION_CONTROLLED_BY, | 3932 IA2_RELATION_CONTROLLED_BY, |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4082 ToBrowserAccessibilityComWin(GetOwner()->PlatformGetParent()); | 4079 ToBrowserAccessibilityComWin(GetOwner()->PlatformGetParent()); |
| 4083 if (parent && GetOwner()->IsTextOnlyObject() && | 4080 if (parent && GetOwner()->IsTextOnlyObject() && |
| 4084 name() != old_win_attributes_->name) { | 4081 name() != old_win_attributes_->name) { |
| 4085 parent->GetOwner()->UpdatePlatformAttributes(); | 4082 parent->GetOwner()->UpdatePlatformAttributes(); |
| 4086 } | 4083 } |
| 4087 } | 4084 } |
| 4088 | 4085 |
| 4089 old_win_attributes_.reset(nullptr); | 4086 old_win_attributes_.reset(nullptr); |
| 4090 } | 4087 } |
| 4091 | 4088 |
| 4089 BrowserAccessibilityManager* BrowserAccessibilityComWin::owners_manager() | |
| 4090 const { | |
| 4091 auto* owner = GetOwner(); | |
| 4092 if (!owner) | |
|
dmazzoni
2017/05/10 06:10:04
Doesn't every single method call GetOwner at the t
| |
| 4093 return nullptr; | |
| 4094 return owner->manager(); | |
| 4095 } | |
| 4096 | |
| 4092 std::vector<base::string16> BrowserAccessibilityComWin::ComputeTextAttributes() | 4097 std::vector<base::string16> BrowserAccessibilityComWin::ComputeTextAttributes() |
| 4093 const { | 4098 const { |
| 4094 std::vector<base::string16> attributes; | 4099 std::vector<base::string16> attributes; |
| 4095 | 4100 |
| 4096 // We include list markers for now, but there might be other objects that are | 4101 // We include list markers for now, but there might be other objects that are |
| 4097 // auto generated. | 4102 // auto generated. |
| 4098 // TODO(nektar): Compute what objects are auto-generated in Blink. | 4103 // TODO(nektar): Compute what objects are auto-generated in Blink. |
| 4099 if (GetOwner()->GetRole() == ui::AX_ROLE_LIST_MARKER) | 4104 if (GetOwner()->GetRole() == ui::AX_ROLE_LIST_MARKER) |
| 4100 attributes.push_back(L"auto-generated:true"); | 4105 attributes.push_back(L"auto-generated:true"); |
| 4101 else | 4106 else |
| (...skipping 276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4378 } | 4383 } |
| 4379 | 4384 |
| 4380 void BrowserAccessibilityComWin::SetIA2HypertextSelection(LONG start_offset, | 4385 void BrowserAccessibilityComWin::SetIA2HypertextSelection(LONG start_offset, |
| 4381 LONG end_offset) { | 4386 LONG end_offset) { |
| 4382 HandleSpecialTextOffset(&start_offset); | 4387 HandleSpecialTextOffset(&start_offset); |
| 4383 HandleSpecialTextOffset(&end_offset); | 4388 HandleSpecialTextOffset(&end_offset); |
| 4384 AXPlatformPositionInstance start_position = | 4389 AXPlatformPositionInstance start_position = |
| 4385 CreatePositionForSelectionAt(static_cast<int>(start_offset)); | 4390 CreatePositionForSelectionAt(static_cast<int>(start_offset)); |
| 4386 AXPlatformPositionInstance end_position = | 4391 AXPlatformPositionInstance end_position = |
| 4387 CreatePositionForSelectionAt(static_cast<int>(end_offset)); | 4392 CreatePositionForSelectionAt(static_cast<int>(end_offset)); |
| 4388 GetOwner()->manager()->SetSelection(AXPlatformRange( | 4393 owners_manager()->SetSelection(AXPlatformRange( |
| 4389 start_position->AsTextPosition(), end_position->AsTextPosition())); | 4394 start_position->AsTextPosition(), end_position->AsTextPosition())); |
| 4390 } | 4395 } |
| 4391 | 4396 |
| 4392 void BrowserAccessibilityComWin::StringAttributeToIA2( | 4397 void BrowserAccessibilityComWin::StringAttributeToIA2( |
| 4393 ui::AXStringAttribute attribute, | 4398 ui::AXStringAttribute attribute, |
| 4394 const char* ia2_attr) { | 4399 const char* ia2_attr) { |
| 4395 base::string16 value; | 4400 base::string16 value; |
| 4396 if (GetOwner()->GetString16Attribute(attribute, &value)) { | 4401 if (GetOwner()->GetString16Attribute(attribute, &value)) { |
| 4397 SanitizeStringAttributeForIA2(value, &value); | 4402 SanitizeStringAttributeForIA2(value, &value); |
| 4398 win_attributes_->ia2_attributes.push_back(base::ASCIIToUTF16(ia2_attr) + | 4403 win_attributes_->ia2_attributes.push_back(base::ASCIIToUTF16(ia2_attr) + |
| (...skipping 190 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4589 if (endpoint_index_in_common_parent < index_in_common_parent) | 4594 if (endpoint_index_in_common_parent < index_in_common_parent) |
| 4590 return 0; | 4595 return 0; |
| 4591 if (endpoint_index_in_common_parent > index_in_common_parent) | 4596 if (endpoint_index_in_common_parent > index_in_common_parent) |
| 4592 return GetOwner()->GetText().size(); | 4597 return GetOwner()->GetText().size(); |
| 4593 | 4598 |
| 4594 NOTREACHED(); | 4599 NOTREACHED(); |
| 4595 return -1; | 4600 return -1; |
| 4596 } | 4601 } |
| 4597 | 4602 |
| 4598 int BrowserAccessibilityComWin::GetSelectionAnchor() const { | 4603 int BrowserAccessibilityComWin::GetSelectionAnchor() const { |
| 4599 int32_t anchor_id = GetOwner()->manager()->GetTreeData().sel_anchor_object_id; | 4604 int32_t anchor_id = owners_manager()->GetTreeData().sel_anchor_object_id; |
| 4600 const BrowserAccessibilityComWin* anchor_object = GetFromID(anchor_id); | 4605 const BrowserAccessibilityComWin* anchor_object = GetFromID(anchor_id); |
| 4601 if (!anchor_object) | 4606 if (!anchor_object) |
| 4602 return -1; | 4607 return -1; |
| 4603 | 4608 |
| 4604 int anchor_offset = GetOwner()->manager()->GetTreeData().sel_anchor_offset; | 4609 int anchor_offset = owners_manager()->GetTreeData().sel_anchor_offset; |
| 4605 return GetHypertextOffsetFromEndpoint(*anchor_object, anchor_offset); | 4610 return GetHypertextOffsetFromEndpoint(*anchor_object, anchor_offset); |
| 4606 } | 4611 } |
| 4607 | 4612 |
| 4608 int BrowserAccessibilityComWin::GetSelectionFocus() const { | 4613 int BrowserAccessibilityComWin::GetSelectionFocus() const { |
| 4609 int32_t focus_id = GetOwner()->manager()->GetTreeData().sel_focus_object_id; | 4614 int32_t focus_id = owners_manager()->GetTreeData().sel_focus_object_id; |
| 4610 const BrowserAccessibilityComWin* focus_object = GetFromID(focus_id); | 4615 const BrowserAccessibilityComWin* focus_object = GetFromID(focus_id); |
| 4611 if (!focus_object) | 4616 if (!focus_object) |
| 4612 return -1; | 4617 return -1; |
| 4613 | 4618 |
| 4614 int focus_offset = GetOwner()->manager()->GetTreeData().sel_focus_offset; | 4619 int focus_offset = owners_manager()->GetTreeData().sel_focus_offset; |
| 4615 return GetHypertextOffsetFromEndpoint(*focus_object, focus_offset); | 4620 return GetHypertextOffsetFromEndpoint(*focus_object, focus_offset); |
| 4616 } | 4621 } |
| 4617 | 4622 |
| 4618 void BrowserAccessibilityComWin::GetSelectionOffsets(int* selection_start, | 4623 void BrowserAccessibilityComWin::GetSelectionOffsets(int* selection_start, |
| 4619 int* selection_end) const { | 4624 int* selection_end) const { |
| 4620 DCHECK(selection_start && selection_end); | 4625 DCHECK(selection_start && selection_end); |
| 4621 | 4626 |
| 4622 if (GetOwner()->IsSimpleTextControl() && | 4627 if (GetOwner()->IsSimpleTextControl() && |
| 4623 GetOwner()->GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START, | 4628 GetOwner()->GetIntAttribute(ui::AX_ATTR_TEXT_SEL_START, |
| 4624 selection_start) && | 4629 selection_start) && |
| (...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4784 | 4789 |
| 4785 LONG BrowserAccessibilityComWin::FindBoundary( | 4790 LONG BrowserAccessibilityComWin::FindBoundary( |
| 4786 const base::string16& text, | 4791 const base::string16& text, |
| 4787 IA2TextBoundaryType ia2_boundary, | 4792 IA2TextBoundaryType ia2_boundary, |
| 4788 LONG start_offset, | 4793 LONG start_offset, |
| 4789 ui::TextBoundaryDirection direction) { | 4794 ui::TextBoundaryDirection direction) { |
| 4790 // If the boundary is relative to the caret, use the selection | 4795 // If the boundary is relative to the caret, use the selection |
| 4791 // affinity, otherwise default to downstream affinity. | 4796 // affinity, otherwise default to downstream affinity. |
| 4792 ui::AXTextAffinity affinity = | 4797 ui::AXTextAffinity affinity = |
| 4793 start_offset == IA2_TEXT_OFFSET_CARET | 4798 start_offset == IA2_TEXT_OFFSET_CARET |
| 4794 ? GetOwner()->manager()->GetTreeData().sel_focus_affinity | 4799 ? owners_manager()->GetTreeData().sel_focus_affinity |
| 4795 : ui::AX_TEXT_AFFINITY_DOWNSTREAM; | 4800 : ui::AX_TEXT_AFFINITY_DOWNSTREAM; |
| 4796 | 4801 |
| 4797 HandleSpecialTextOffset(&start_offset); | 4802 HandleSpecialTextOffset(&start_offset); |
| 4798 if (ia2_boundary == IA2_TEXT_BOUNDARY_WORD) { | 4803 if (ia2_boundary == IA2_TEXT_BOUNDARY_WORD) { |
| 4799 switch (direction) { | 4804 switch (direction) { |
| 4800 case ui::FORWARDS_DIRECTION: { | 4805 case ui::FORWARDS_DIRECTION: { |
| 4801 AXPlatformPositionInstance position = GetOwner()->CreatePositionAt( | 4806 AXPlatformPositionInstance position = GetOwner()->CreatePositionAt( |
| 4802 static_cast<int>(start_offset), affinity); | 4807 static_cast<int>(start_offset), affinity); |
| 4803 AXPlatformPositionInstance next_word = | 4808 AXPlatformPositionInstance next_word = |
| 4804 position->CreateNextWordStartPosition(); | 4809 position->CreateNextWordStartPosition(); |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4882 } | 4887 } |
| 4883 | 4888 |
| 4884 NOTREACHED(); | 4889 NOTREACHED(); |
| 4885 return start_offset; | 4890 return start_offset; |
| 4886 } | 4891 } |
| 4887 | 4892 |
| 4888 BrowserAccessibilityComWin* BrowserAccessibilityComWin::GetFromID( | 4893 BrowserAccessibilityComWin* BrowserAccessibilityComWin::GetFromID( |
| 4889 int32_t id) const { | 4894 int32_t id) const { |
| 4890 if (!GetOwner()) | 4895 if (!GetOwner()) |
| 4891 return nullptr; | 4896 return nullptr; |
| 4892 return ToBrowserAccessibilityComWin(GetOwner()->manager()->GetFromID(id)); | 4897 return ToBrowserAccessibilityComWin(owners_manager()->GetFromID(id)); |
| 4893 } | 4898 } |
| 4894 | 4899 |
| 4895 bool BrowserAccessibilityComWin::IsListBoxOptionOrMenuListOption() { | 4900 bool BrowserAccessibilityComWin::IsListBoxOptionOrMenuListOption() { |
| 4896 if (!GetOwner()->PlatformGetParent()) | 4901 if (!GetOwner()->PlatformGetParent()) |
| 4897 return false; | 4902 return false; |
| 4898 | 4903 |
| 4899 int32_t role = GetOwner()->GetRole(); | 4904 int32_t role = GetOwner()->GetRole(); |
| 4900 int32_t parent_role = GetOwner()->PlatformGetParent()->GetRole(); | 4905 int32_t parent_role = GetOwner()->PlatformGetParent()->GetRole(); |
| 4901 | 4906 |
| 4902 if (role == ui::AX_ROLE_LIST_BOX_OPTION && | 4907 if (role == ui::AX_ROLE_LIST_BOX_OPTION && |
| (...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5720 | 5725 |
| 5721 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( | 5726 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( |
| 5722 BrowserAccessibility* obj) { | 5727 BrowserAccessibility* obj) { |
| 5723 if (!obj || !obj->IsNative()) | 5728 if (!obj || !obj->IsNative()) |
| 5724 return nullptr; | 5729 return nullptr; |
| 5725 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); | 5730 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); |
| 5726 return result; | 5731 return result; |
| 5727 } | 5732 } |
| 5728 | 5733 |
| 5729 } // namespace content | 5734 } // namespace content |
| OLD | NEW |