tests/cefclient/browser/osr_accessibility_node_win.cc
// Return focused element from the accessibility tree
Return focused element from the accessibility tree
Return focused element from the accessibility tree
STDMETHODIMP CefIAccessible::get_accFocus(VARIANT* pFocusChild) {
  HRESULT retCode = DATACHECK(node_);
  if (SUCCEEDED(retCode)) {
    OsrAXNode* focusedNode = node_->GetAccessibilityHelper()->GetFocusedNode();
    CefNativeAccessible* nativeObj = nullptr;
    if (focusedNode)
      nativeObj = focusedNode->GetNativeAccessibleObject(nullptr);
    if (nativeObj) {
      if (nativeObj == this) {
        pFocusChild->vt = VT_I4;
        pFocusChild->lVal = CHILDID_SELF;
      } else {
        pFocusChild->vt = VT_DISPATCH;
        pFocusChild->pdispVal = nativeObj;
        pFocusChild->pdispVal->AddRef();
      }
    } else {
      pFocusChild->vt = VT_EMPTY;
    }
  }
  return retCode;
}
STDMETHODIMP CefIAccessible :: get_accFocus ( VARIANT * pFocusChild ) { HRESULT retCode = DATACHECK ( node_ ) ; if ( SUCCEEDED ( retCode ) ) { OsrAXNode * focusedNode = node_ -> GetAccessibilityHelper ( ) -> GetFocusedNode ( ) ; CefNativeAccessible * nativeObj = nullptr ; if ( focusedNode ) nativeObj = focusedNode -> GetNativeAccessibleObject ( nullptr ) ; if ( nativeObj ) { if ( nativeObj == this ) { pFocusChild -> vt = VT_I4 ; pFocusChild -> lVal = CHILDID_SELF ; } else { pFocusChild -> vt = VT_DISPATCH ; pFocusChild -> pdispVal = nativeObj ; pFocusChild -> pdispVal -> AddRef ( ) ; } } else { pFocusChild -> vt = VT_EMPTY ; } } return retCode ; }
Return focused element from the accessibility tree
Return focused element from the accessibility tree