| 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 624 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 635 | 635 |
| 636 return AXPlatformNodeWin::get_accRole(var_id, role); | 636 return AXPlatformNodeWin::get_accRole(var_id, role); |
| 637 } | 637 } |
| 638 | 638 |
| 639 STDMETHODIMP BrowserAccessibilityComWin::get_accState(VARIANT var_id, | 639 STDMETHODIMP BrowserAccessibilityComWin::get_accState(VARIANT var_id, |
| 640 VARIANT* state) { | 640 VARIANT* state) { |
| 641 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_STATE); | 641 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_STATE); |
| 642 if (!owner()) | 642 if (!owner()) |
| 643 return E_FAIL; | 643 return E_FAIL; |
| 644 | 644 |
| 645 auto* manager = Manager(); | 645 return AXPlatformNodeWin::get_accState(var_id, state); |
| 646 if (!manager) | |
| 647 return E_FAIL; | |
| 648 | |
| 649 if (!state) | |
| 650 return E_INVALIDARG; | |
| 651 | |
| 652 BrowserAccessibilityComWin* target = GetTargetFromChildID(var_id); | |
| 653 if (!target) | |
| 654 return E_INVALIDARG; | |
| 655 | |
| 656 state->vt = VT_I4; | |
| 657 state->lVal = target->ia_state(); | |
| 658 if (manager->GetFocus() == owner()) | |
| 659 state->lVal |= STATE_SYSTEM_FOCUSED; | |
| 660 | |
| 661 return S_OK; | |
| 662 } | 646 } |
| 663 | 647 |
| 664 bool BrowserAccessibilityComWin::IsRangeValueSupported() { | 648 bool BrowserAccessibilityComWin::IsRangeValueSupported() { |
| 665 switch (ia_role()) { | 649 switch (ia_role()) { |
| 666 case ROLE_SYSTEM_PROGRESSBAR: | 650 case ROLE_SYSTEM_PROGRESSBAR: |
| 667 case ROLE_SYSTEM_SLIDER: | 651 case ROLE_SYSTEM_SLIDER: |
| 668 case ROLE_SYSTEM_SPINBUTTON: | 652 case ROLE_SYSTEM_SPINBUTTON: |
| 669 case ROLE_SYSTEM_SCROLLBAR: | 653 case ROLE_SYSTEM_SCROLLBAR: |
| 670 return true; | 654 return true; |
| 671 case ROLE_SYSTEM_SEPARATOR: | 655 case ROLE_SYSTEM_SEPARATOR: |
| (...skipping 4935 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5607 | 5591 |
| 5608 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( | 5592 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( |
| 5609 BrowserAccessibility* obj) { | 5593 BrowserAccessibility* obj) { |
| 5610 if (!obj || !obj->IsNative()) | 5594 if (!obj || !obj->IsNative()) |
| 5611 return nullptr; | 5595 return nullptr; |
| 5612 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); | 5596 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); |
| 5613 return result; | 5597 return result; |
| 5614 } | 5598 } |
| 5615 | 5599 |
| 5616 } // namespace content | 5600 } // namespace content |
| OLD | NEW |