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 613 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 624 | 624 |
| 625 return AXPlatformNodeWin::get_accRole(var_id, role); | 625 return AXPlatformNodeWin::get_accRole(var_id, role); |
| 626 } | 626 } |
| 627 | 627 |
| 628 STDMETHODIMP BrowserAccessibilityComWin::get_accState(VARIANT var_id, | 628 STDMETHODIMP BrowserAccessibilityComWin::get_accState(VARIANT var_id, |
| 629 VARIANT* state) { | 629 VARIANT* state) { |
| 630 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_STATE); | 630 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_STATE); |
| 631 if (!owner()) | 631 if (!owner()) |
| 632 return E_FAIL; | 632 return E_FAIL; |
| 633 | 633 |
| 634 auto* manager = Manager(); | 634 return AXPlatformNodeWin::get_accState(var_id, state); |
|
dmazzoni
2017/06/26 17:18:24
We have duplicate code to compute ia_state now, wh
dougt
2017/06/27 04:49:51
Good call. I found that MSAAState() and ia_state(
| |
| 635 if (!manager) | |
| 636 return E_FAIL; | |
| 637 | |
| 638 if (!state) | |
| 639 return E_INVALIDARG; | |
| 640 | |
| 641 BrowserAccessibilityComWin* target = GetTargetFromChildID(var_id); | |
| 642 if (!target) | |
| 643 return E_INVALIDARG; | |
| 644 | |
| 645 state->vt = VT_I4; | |
| 646 state->lVal = target->ia_state(); | |
| 647 if (manager->GetFocus() == owner()) | |
| 648 state->lVal |= STATE_SYSTEM_FOCUSED; | |
| 649 | |
| 650 return S_OK; | |
| 651 } | 635 } |
| 652 | 636 |
| 653 bool BrowserAccessibilityComWin::IsRangeValueSupported() { | 637 bool BrowserAccessibilityComWin::IsRangeValueSupported() { |
| 654 switch (ia_role()) { | 638 switch (ia_role()) { |
| 655 case ROLE_SYSTEM_PROGRESSBAR: | 639 case ROLE_SYSTEM_PROGRESSBAR: |
| 656 case ROLE_SYSTEM_SLIDER: | 640 case ROLE_SYSTEM_SLIDER: |
| 657 case ROLE_SYSTEM_SPINBUTTON: | 641 case ROLE_SYSTEM_SPINBUTTON: |
| 658 case ROLE_SYSTEM_SCROLLBAR: | 642 case ROLE_SYSTEM_SCROLLBAR: |
| 659 return true; | 643 return true; |
| 660 case ROLE_SYSTEM_SEPARATOR: | 644 case ROLE_SYSTEM_SEPARATOR: |
| (...skipping 4909 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5570 | 5554 |
| 5571 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( | 5555 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( |
| 5572 BrowserAccessibility* obj) { | 5556 BrowserAccessibility* obj) { |
| 5573 if (!obj || !obj->IsNative()) | 5557 if (!obj || !obj->IsNative()) |
| 5574 return nullptr; | 5558 return nullptr; |
| 5575 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); | 5559 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); |
| 5576 return result; | 5560 return result; |
| 5577 } | 5561 } |
| 5578 | 5562 |
| 5579 } // namespace content | 5563 } // namespace content |
| OLD | NEW |