Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(679)

Side by Side Diff: content/browser/accessibility/browser_accessibility_com_win.cc

Issue 2913553002: Forward BrowserAccessibility get_accState to AXPlatformNode. (Closed)
Patch Set: linux needs love too Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 638 matching lines...) Expand 10 before | Expand all | Expand 10 after
649 } 649 }
650 return S_OK; 650 return S_OK;
651 } 651 }
652 652
653 STDMETHODIMP BrowserAccessibilityComWin::get_accState(VARIANT var_id, 653 STDMETHODIMP BrowserAccessibilityComWin::get_accState(VARIANT var_id,
654 VARIANT* state) { 654 VARIANT* state) {
655 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_STATE); 655 WIN_ACCESSIBILITY_API_HISTOGRAM(UMA_API_GET_ACC_STATE);
656 if (!owner()) 656 if (!owner())
657 return E_FAIL; 657 return E_FAIL;
658 658
659 auto* manager = Manager(); 659 return AXPlatformNodeWin::get_accState(var_id, state);
660 if (!manager)
661 return E_FAIL;
662
663 if (!state)
664 return E_INVALIDARG;
665
666 BrowserAccessibilityComWin* target = GetTargetFromChildID(var_id);
667 if (!target)
668 return E_INVALIDARG;
669
670 state->vt = VT_I4;
671 state->lVal = target->ia_state();
672 if (manager->GetFocus() == owner())
673 state->lVal |= STATE_SYSTEM_FOCUSED;
674
675 return S_OK;
676 } 660 }
677 661
678 bool BrowserAccessibilityComWin::IsRangeValueSupported() { 662 bool BrowserAccessibilityComWin::IsRangeValueSupported() {
679 switch (ia_role()) { 663 switch (ia_role()) {
680 case ROLE_SYSTEM_PROGRESSBAR: 664 case ROLE_SYSTEM_PROGRESSBAR:
681 case ROLE_SYSTEM_SLIDER: 665 case ROLE_SYSTEM_SLIDER:
682 case ROLE_SYSTEM_SPINBUTTON: 666 case ROLE_SYSTEM_SPINBUTTON:
683 case ROLE_SYSTEM_SCROLLBAR: 667 case ROLE_SYSTEM_SCROLLBAR:
684 return true; 668 return true;
685 case ROLE_SYSTEM_SEPARATOR: 669 case ROLE_SYSTEM_SEPARATOR:
(...skipping 4948 matching lines...) Expand 10 before | Expand all | Expand 10 after
5634 5618
5635 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin( 5619 BrowserAccessibilityComWin* ToBrowserAccessibilityComWin(
5636 BrowserAccessibility* obj) { 5620 BrowserAccessibility* obj) {
5637 if (!obj || !obj->IsNative()) 5621 if (!obj || !obj->IsNative())
5638 return nullptr; 5622 return nullptr;
5639 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM(); 5623 auto* result = static_cast<BrowserAccessibilityWin*>(obj)->GetCOM();
5640 return result; 5624 return result;
5641 } 5625 }
5642 5626
5643 } // namespace content 5627 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698