Commit b1cdadd9 authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

Add IChromeAccessible, a custom async COM accessibility API

This change introduces the first draft of a possible
Chrome-specific COM API for accessibility that's async-only
and could potentially lead to better performance and
more easily allow Windows assistive technology to avoid
injecting in-process.

This new interface is behind a feature flag with no intention
of launching as-is - if this proves to be successful we
should either standardize this as part of an existing
API like IAccessible2, or else create a new public spec
for it.

For now, the goal is to make something available for
experimenting and building a proof-of-concept.

Bug: 1083834
AX-Relnotes: None
Change-Id: I32fb830217f55e1b1b214b1044362d9c2c42f5b7
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2206224Reviewed-by: default avatarNico Weber <thakis@chromium.org>
Reviewed-by: default avatarAaron Leventhal <aleventhal@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Auto-Submit: Dominic Mazzoni <dmazzoni@chromium.org>
Cr-Commit-Position: refs/heads/master@{#772425}
parent 0481d82f
/*********************************************************
DllData file -- generated by MIDL compiler
DO NOT ALTER THIS FILE
This file is regenerated by MIDL on every IDL file compile.
To completely reconstruct this file, delete it and rerun MIDL
on all the IDL files in this DLL, specifying this file for the
/dlldata command line option
*********************************************************/
#include <rpcproxy.h>
#ifdef __cplusplus
extern "C" {
#endif
EXTERN_PROXY_FILE( ichromeaccessible )
PROXYFILE_LIST_START
/* Start of list */
REFERENCE_PROXY_FILE( ichromeaccessible ),
/* End of list */
PROXYFILE_LIST_END
DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
#ifdef __cplusplus
} /*extern "C" */
#endif
/* end of generated dlldata file */
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.xx.xxxx */
/* at a redacted point in time
*/
/* Compiler settings for ../../ui/accessibility/platform/ichromeaccessible.idl:
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.xx.xxxx
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __ichromeaccessible_h__
#define __ichromeaccessible_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IChromeAccessibleDelegate_FWD_DEFINED__
#define __IChromeAccessibleDelegate_FWD_DEFINED__
typedef interface IChromeAccessibleDelegate IChromeAccessibleDelegate;
#endif /* __IChromeAccessibleDelegate_FWD_DEFINED__ */
#ifndef __IChromeAccessible_FWD_DEFINED__
#define __IChromeAccessible_FWD_DEFINED__
typedef interface IChromeAccessible IChromeAccessible;
#endif /* __IChromeAccessible_FWD_DEFINED__ */
/* header files for imported files */
#include "objidl.h"
#include "oaidl.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_ichromeaccessible_0000_0000 */
/* [local] */
#define DISPID_CHROME_BULK_FETCH ( -1600 )
#define DISPID_CHROME_ON_BULK_FETCH_RESULT ( -1601 )
#define DISPID_CHROME_HIT_TEST ( -1602 )
#define DISPID_CHROME_ON_HIT_TEST_RESULT ( -1603 )
extern RPC_IF_HANDLE __MIDL_itf_ichromeaccessible_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_ichromeaccessible_0000_0000_v0_0_s_ifspec;
#ifndef __IChromeAccessibleDelegate_INTERFACE_DEFINED__
#define __IChromeAccessibleDelegate_INTERFACE_DEFINED__
/* interface IChromeAccessibleDelegate */
/* [unique][uuid][object] */
EXTERN_C const IID IID_IChromeAccessibleDelegate;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("0e3edc14-79f4-413f-b854-d3b6860d74a2")
IChromeAccessibleDelegate : public IUnknown
{
public:
virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bulkFetchResult(
/* [in] */ LONG requestID,
/* [in] */ BSTR resultJson) = 0;
virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_hitTestResult(
/* [in] */ LONG requestID,
/* [in] */ IUnknown *result) = 0;
};
#else /* C style interface */
typedef struct IChromeAccessibleDelegateVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IChromeAccessibleDelegate * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IChromeAccessibleDelegate * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IChromeAccessibleDelegate * This);
/* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_bulkFetchResult )(
IChromeAccessibleDelegate * This,
/* [in] */ LONG requestID,
/* [in] */ BSTR resultJson);
/* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_hitTestResult )(
IChromeAccessibleDelegate * This,
/* [in] */ LONG requestID,
/* [in] */ IUnknown *result);
END_INTERFACE
} IChromeAccessibleDelegateVtbl;
interface IChromeAccessibleDelegate
{
CONST_VTBL struct IChromeAccessibleDelegateVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IChromeAccessibleDelegate_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IChromeAccessibleDelegate_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IChromeAccessibleDelegate_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IChromeAccessibleDelegate_put_bulkFetchResult(This,requestID,resultJson) \
( (This)->lpVtbl -> put_bulkFetchResult(This,requestID,resultJson) )
#define IChromeAccessibleDelegate_put_hitTestResult(This,requestID,result) \
( (This)->lpVtbl -> put_hitTestResult(This,requestID,result) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IChromeAccessibleDelegate_INTERFACE_DEFINED__ */
#ifndef __IChromeAccessible_INTERFACE_DEFINED__
#define __IChromeAccessible_INTERFACE_DEFINED__
/* interface IChromeAccessible */
/* [unique][uuid][object] */
EXTERN_C const IID IID_IChromeAccessible;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("6175bd95-3b2e-4ebc-bc51-9cab782bec92")
IChromeAccessible : public IUnknown
{
public:
virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bulkFetch(
/* [in] */ BSTR inputJson,
/* [in] */ LONG requestID,
/* [in] */ IChromeAccessibleDelegate *delegate) = 0;
virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_hitTest(
/* [in] */ LONG screenPhysicalPixelX,
/* [in] */ LONG screenPhysicalPixelY,
/* [in] */ LONG requestID,
/* [in] */ IChromeAccessibleDelegate *delegate) = 0;
};
#else /* C style interface */
typedef struct IChromeAccessibleVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IChromeAccessible * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IChromeAccessible * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IChromeAccessible * This);
/* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_bulkFetch )(
IChromeAccessible * This,
/* [in] */ BSTR inputJson,
/* [in] */ LONG requestID,
/* [in] */ IChromeAccessibleDelegate *delegate);
/* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_hitTest )(
IChromeAccessible * This,
/* [in] */ LONG screenPhysicalPixelX,
/* [in] */ LONG screenPhysicalPixelY,
/* [in] */ LONG requestID,
/* [in] */ IChromeAccessibleDelegate *delegate);
END_INTERFACE
} IChromeAccessibleVtbl;
interface IChromeAccessible
{
CONST_VTBL struct IChromeAccessibleVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IChromeAccessible_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IChromeAccessible_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IChromeAccessible_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IChromeAccessible_get_bulkFetch(This,inputJson,requestID,delegate) \
( (This)->lpVtbl -> get_bulkFetch(This,inputJson,requestID,delegate) )
#define IChromeAccessible_get_hitTest(This,screenPhysicalPixelX,screenPhysicalPixelY,requestID,delegate) \
( (This)->lpVtbl -> get_hitTest(This,screenPhysicalPixelX,screenPhysicalPixelY,requestID,delegate) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IChromeAccessible_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * );
unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * );
unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * );
void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * );
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 8.xx.xxxx */
/* at a redacted point in time
*/
/* Compiler settings for ../../ui/accessibility/platform/ichromeaccessible.idl:
Oicf, W1, Zp8, env=Win64 (32b run), target_arch=AMD64 8.xx.xxxx
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
#ifdef __cplusplus
extern "C"{
#endif
#include <rpc.h>
#include <rpcndr.h>
#ifdef _MIDL_USE_GUIDDEF_
#ifndef INITGUID
#define INITGUID
#include <guiddef.h>
#undef INITGUID
#else
#include <guiddef.h>
#endif
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
#else // !_MIDL_USE_GUIDDEF_
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef struct _IID
{
unsigned long x;
unsigned short s1;
unsigned short s2;
unsigned char c[8];
} IID;
#endif // __IID_DEFINED__
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef IID CLSID;
#endif // CLSID_DEFINED
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
EXTERN_C __declspec(selectany) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
#endif // !_MIDL_USE_GUIDDEF_
MIDL_DEFINE_GUID(IID, IID_IChromeAccessibleDelegate,0x0e3edc14,0x79f4,0x413f,0xb8,0x54,0xd3,0xb6,0x86,0x0d,0x74,0xa2);
MIDL_DEFINE_GUID(IID, IID_IChromeAccessible,0x6175bd95,0x3b2e,0x4ebc,0xbc,0x51,0x9c,0xab,0x78,0x2b,0xec,0x92);
#undef MIDL_DEFINE_GUID
#ifdef __cplusplus
}
#endif
/*********************************************************
DllData file -- generated by MIDL compiler
DO NOT ALTER THIS FILE
This file is regenerated by MIDL on every IDL file compile.
To completely reconstruct this file, delete it and rerun MIDL
on all the IDL files in this DLL, specifying this file for the
/dlldata command line option
*********************************************************/
#include <rpcproxy.h>
#ifdef __cplusplus
extern "C" {
#endif
EXTERN_PROXY_FILE( ichromeaccessible )
PROXYFILE_LIST_START
/* Start of list */
REFERENCE_PROXY_FILE( ichromeaccessible ),
/* End of list */
PROXYFILE_LIST_END
DLLDATA_ROUTINES( aProxyFileList, GET_DLL_CLSID )
#ifdef __cplusplus
} /*extern "C" */
#endif
/* end of generated dlldata file */
/* this ALWAYS GENERATED file contains the definitions for the interfaces */
/* File created by MIDL compiler version 8.xx.xxxx */
/* at a redacted point in time
*/
/* Compiler settings for ../../ui/accessibility/platform/ichromeaccessible.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.xx.xxxx
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
/* verify that the <rpcndr.h> version is high enough to compile this file*/
#ifndef __REQUIRED_RPCNDR_H_VERSION__
#define __REQUIRED_RPCNDR_H_VERSION__ 475
#endif
#include "rpc.h"
#include "rpcndr.h"
#ifndef __RPCNDR_H_VERSION__
#error this stub requires an updated version of <rpcndr.h>
#endif /* __RPCNDR_H_VERSION__ */
#ifndef COM_NO_WINDOWS_H
#include "windows.h"
#include "ole2.h"
#endif /*COM_NO_WINDOWS_H*/
#ifndef __ichromeaccessible_h__
#define __ichromeaccessible_h__
#if defined(_MSC_VER) && (_MSC_VER >= 1020)
#pragma once
#endif
/* Forward Declarations */
#ifndef __IChromeAccessibleDelegate_FWD_DEFINED__
#define __IChromeAccessibleDelegate_FWD_DEFINED__
typedef interface IChromeAccessibleDelegate IChromeAccessibleDelegate;
#endif /* __IChromeAccessibleDelegate_FWD_DEFINED__ */
#ifndef __IChromeAccessible_FWD_DEFINED__
#define __IChromeAccessible_FWD_DEFINED__
typedef interface IChromeAccessible IChromeAccessible;
#endif /* __IChromeAccessible_FWD_DEFINED__ */
/* header files for imported files */
#include "objidl.h"
#include "oaidl.h"
#ifdef __cplusplus
extern "C"{
#endif
/* interface __MIDL_itf_ichromeaccessible_0000_0000 */
/* [local] */
#define DISPID_CHROME_BULK_FETCH ( -1600 )
#define DISPID_CHROME_ON_BULK_FETCH_RESULT ( -1601 )
#define DISPID_CHROME_HIT_TEST ( -1602 )
#define DISPID_CHROME_ON_HIT_TEST_RESULT ( -1603 )
extern RPC_IF_HANDLE __MIDL_itf_ichromeaccessible_0000_0000_v0_0_c_ifspec;
extern RPC_IF_HANDLE __MIDL_itf_ichromeaccessible_0000_0000_v0_0_s_ifspec;
#ifndef __IChromeAccessibleDelegate_INTERFACE_DEFINED__
#define __IChromeAccessibleDelegate_INTERFACE_DEFINED__
/* interface IChromeAccessibleDelegate */
/* [unique][uuid][object] */
EXTERN_C const IID IID_IChromeAccessibleDelegate;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("0e3edc14-79f4-413f-b854-d3b6860d74a2")
IChromeAccessibleDelegate : public IUnknown
{
public:
virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_bulkFetchResult(
/* [in] */ LONG requestID,
/* [in] */ BSTR resultJson) = 0;
virtual /* [id][propput] */ HRESULT STDMETHODCALLTYPE put_hitTestResult(
/* [in] */ LONG requestID,
/* [in] */ IUnknown *result) = 0;
};
#else /* C style interface */
typedef struct IChromeAccessibleDelegateVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IChromeAccessibleDelegate * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IChromeAccessibleDelegate * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IChromeAccessibleDelegate * This);
/* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_bulkFetchResult )(
IChromeAccessibleDelegate * This,
/* [in] */ LONG requestID,
/* [in] */ BSTR resultJson);
/* [id][propput] */ HRESULT ( STDMETHODCALLTYPE *put_hitTestResult )(
IChromeAccessibleDelegate * This,
/* [in] */ LONG requestID,
/* [in] */ IUnknown *result);
END_INTERFACE
} IChromeAccessibleDelegateVtbl;
interface IChromeAccessibleDelegate
{
CONST_VTBL struct IChromeAccessibleDelegateVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IChromeAccessibleDelegate_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IChromeAccessibleDelegate_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IChromeAccessibleDelegate_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IChromeAccessibleDelegate_put_bulkFetchResult(This,requestID,resultJson) \
( (This)->lpVtbl -> put_bulkFetchResult(This,requestID,resultJson) )
#define IChromeAccessibleDelegate_put_hitTestResult(This,requestID,result) \
( (This)->lpVtbl -> put_hitTestResult(This,requestID,result) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IChromeAccessibleDelegate_INTERFACE_DEFINED__ */
#ifndef __IChromeAccessible_INTERFACE_DEFINED__
#define __IChromeAccessible_INTERFACE_DEFINED__
/* interface IChromeAccessible */
/* [unique][uuid][object] */
EXTERN_C const IID IID_IChromeAccessible;
#if defined(__cplusplus) && !defined(CINTERFACE)
MIDL_INTERFACE("6175bd95-3b2e-4ebc-bc51-9cab782bec92")
IChromeAccessible : public IUnknown
{
public:
virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_bulkFetch(
/* [in] */ BSTR inputJson,
/* [in] */ LONG requestID,
/* [in] */ IChromeAccessibleDelegate *delegate) = 0;
virtual /* [id][propget] */ HRESULT STDMETHODCALLTYPE get_hitTest(
/* [in] */ LONG screenPhysicalPixelX,
/* [in] */ LONG screenPhysicalPixelY,
/* [in] */ LONG requestID,
/* [in] */ IChromeAccessibleDelegate *delegate) = 0;
};
#else /* C style interface */
typedef struct IChromeAccessibleVtbl
{
BEGIN_INTERFACE
HRESULT ( STDMETHODCALLTYPE *QueryInterface )(
IChromeAccessible * This,
/* [in] */ REFIID riid,
/* [annotation][iid_is][out] */
_COM_Outptr_ void **ppvObject);
ULONG ( STDMETHODCALLTYPE *AddRef )(
IChromeAccessible * This);
ULONG ( STDMETHODCALLTYPE *Release )(
IChromeAccessible * This);
/* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_bulkFetch )(
IChromeAccessible * This,
/* [in] */ BSTR inputJson,
/* [in] */ LONG requestID,
/* [in] */ IChromeAccessibleDelegate *delegate);
/* [id][propget] */ HRESULT ( STDMETHODCALLTYPE *get_hitTest )(
IChromeAccessible * This,
/* [in] */ LONG screenPhysicalPixelX,
/* [in] */ LONG screenPhysicalPixelY,
/* [in] */ LONG requestID,
/* [in] */ IChromeAccessibleDelegate *delegate);
END_INTERFACE
} IChromeAccessibleVtbl;
interface IChromeAccessible
{
CONST_VTBL struct IChromeAccessibleVtbl *lpVtbl;
};
#ifdef COBJMACROS
#define IChromeAccessible_QueryInterface(This,riid,ppvObject) \
( (This)->lpVtbl -> QueryInterface(This,riid,ppvObject) )
#define IChromeAccessible_AddRef(This) \
( (This)->lpVtbl -> AddRef(This) )
#define IChromeAccessible_Release(This) \
( (This)->lpVtbl -> Release(This) )
#define IChromeAccessible_get_bulkFetch(This,inputJson,requestID,delegate) \
( (This)->lpVtbl -> get_bulkFetch(This,inputJson,requestID,delegate) )
#define IChromeAccessible_get_hitTest(This,screenPhysicalPixelX,screenPhysicalPixelY,requestID,delegate) \
( (This)->lpVtbl -> get_hitTest(This,screenPhysicalPixelX,screenPhysicalPixelY,requestID,delegate) )
#endif /* COBJMACROS */
#endif /* C style interface */
#endif /* __IChromeAccessible_INTERFACE_DEFINED__ */
/* Additional Prototypes for ALL interfaces */
unsigned long __RPC_USER BSTR_UserSize( unsigned long *, unsigned long , BSTR * );
unsigned char * __RPC_USER BSTR_UserMarshal( unsigned long *, unsigned char *, BSTR * );
unsigned char * __RPC_USER BSTR_UserUnmarshal(unsigned long *, unsigned char *, BSTR * );
void __RPC_USER BSTR_UserFree( unsigned long *, BSTR * );
/* end of Additional Prototypes */
#ifdef __cplusplus
}
#endif
#endif
/* this ALWAYS GENERATED file contains the IIDs and CLSIDs */
/* link this file in with the server and any clients */
/* File created by MIDL compiler version 8.xx.xxxx */
/* at a redacted point in time
*/
/* Compiler settings for ../../ui/accessibility/platform/ichromeaccessible.idl:
Oicf, W1, Zp8, env=Win32 (32b run), target_arch=X86 8.xx.xxxx
protocol : dce , ms_ext, c_ext, robust
error checks: allocation ref bounds_check enum stub_data
VC __declspec() decoration level:
__declspec(uuid()), __declspec(selectany), __declspec(novtable)
DECLSPEC_UUID(), MIDL_INTERFACE()
*/
/* @@MIDL_FILE_HEADING( ) */
#pragma warning( disable: 4049 ) /* more than 64k source lines */
#ifdef __cplusplus
extern "C"{
#endif
#include <rpc.h>
#include <rpcndr.h>
#ifdef _MIDL_USE_GUIDDEF_
#ifndef INITGUID
#define INITGUID
#include <guiddef.h>
#undef INITGUID
#else
#include <guiddef.h>
#endif
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
DEFINE_GUID(name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8)
#else // !_MIDL_USE_GUIDDEF_
#ifndef __IID_DEFINED__
#define __IID_DEFINED__
typedef struct _IID
{
unsigned long x;
unsigned short s1;
unsigned short s2;
unsigned char c[8];
} IID;
#endif // __IID_DEFINED__
#ifndef CLSID_DEFINED
#define CLSID_DEFINED
typedef IID CLSID;
#endif // CLSID_DEFINED
#define MIDL_DEFINE_GUID(type,name,l,w1,w2,b1,b2,b3,b4,b5,b6,b7,b8) \
EXTERN_C __declspec(selectany) const type name = {l,w1,w2,{b1,b2,b3,b4,b5,b6,b7,b8}}
#endif // !_MIDL_USE_GUIDDEF_
MIDL_DEFINE_GUID(IID, IID_IChromeAccessibleDelegate,0x0e3edc14,0x79f4,0x413f,0xb8,0x54,0xd3,0xb6,0x86,0x0d,0x74,0xa2);
MIDL_DEFINE_GUID(IID, IID_IChromeAccessible,0x6175bd95,0x3b2e,0x4ebc,0xbc,0x51,0x9c,0xab,0x78,0x2b,0xec,0x92);
#undef MIDL_DEFINE_GUID
#ifdef __cplusplus
}
#endif
...@@ -11,4 +11,6 @@ ninja -C out\gn ^ ...@@ -11,4 +11,6 @@ ninja -C out\gn ^
gen/third_party/iaccessible2/ia2_api_all.h ^ gen/third_party/iaccessible2/ia2_api_all.h ^
gen/third_party/isimpledom/ISimpleDOMDocument.h ^ gen/third_party/isimpledom/ISimpleDOMDocument.h ^
gen/third_party/isimpledom/ISimpleDOMNode.h ^ gen/third_party/isimpledom/ISimpleDOMNode.h ^
gen/third_party/isimpledom/ISimpleDOMText.h gen/third_party/isimpledom/ISimpleDOMText.h ^
gen/ui/accessibility/platform/ichromeaccessible.h
...@@ -16,6 +16,10 @@ if (is_android) { ...@@ -16,6 +16,10 @@ if (is_android) {
import("//build/config/android/rules.gni") import("//build/config/android/rules.gni")
} }
if (is_win) {
import("//build/toolchain/win/midl.gni")
}
# Reset sources_assignment_filter for the BUILD.gn file to prevent # Reset sources_assignment_filter for the BUILD.gn file to prevent
# regression during the migration of Chromium away from the feature. # regression during the migration of Chromium away from the feature.
# See docs/no_sources_assignment_filter.md for more information. # See docs/no_sources_assignment_filter.md for more information.
...@@ -70,6 +74,14 @@ jumbo_component("ax_base") { ...@@ -70,6 +74,14 @@ jumbo_component("ax_base") {
] ]
} }
#if (is_win) {
# midl("ichromeaccessible") {
# sources = [
# "platform/ichromeaccessible.idl",
# ]
# }
#}
jumbo_component("accessibility") { jumbo_component("accessibility") {
defines = [ "AX_IMPLEMENTATION" ] defines = [ "AX_IMPLEMENTATION" ]
...@@ -204,7 +216,10 @@ jumbo_component("accessibility") { ...@@ -204,7 +216,10 @@ jumbo_component("accessibility") {
"platform/ax_system_caret_win.h", "platform/ax_system_caret_win.h",
] ]
public_deps += [ "//third_party/iaccessible2" ] public_deps += [
"//third_party/iaccessible2",
"//ui/accessibility/platform:ichromeaccessible",
]
libs = [ libs = [
"oleacc.lib", "oleacc.lib",
...@@ -358,7 +373,10 @@ test("accessibility_unittests") { ...@@ -358,7 +373,10 @@ test("accessibility_unittests") {
] ]
if (is_win) { if (is_win) {
deps += [ "//third_party/iaccessible2" ] deps += [
"//third_party/iaccessible2",
"//ui/accessibility/platform:ichromeaccessible",
]
libs = [ libs = [
"oleacc.lib", "oleacc.lib",
......
...@@ -54,4 +54,13 @@ bool IsAccessibilityFocusHighlightEnabled() { ...@@ -54,4 +54,13 @@ bool IsAccessibilityFocusHighlightEnabled() {
return base::FeatureList::IsEnabled(::features::kAccessibilityFocusHighlight); return base::FeatureList::IsEnabled(::features::kAccessibilityFocusHighlight);
} }
#if defined(OS_WIN)
const base::Feature kIChromeAccessible{"IChromeAccessible",
base::FEATURE_DISABLED_BY_DEFAULT};
bool IsIChromeAccessibleEnabled() {
return base::FeatureList::IsEnabled(::features::kIChromeAccessible);
}
#endif // defined(OS_WIN)
} // namespace features } // namespace features
...@@ -45,6 +45,15 @@ AX_EXPORT extern const base::Feature kAccessibilityFocusHighlight; ...@@ -45,6 +45,15 @@ AX_EXPORT extern const base::Feature kAccessibilityFocusHighlight;
// briefly whenever focus changes. // briefly whenever focus changes.
AX_EXPORT bool IsAccessibilityFocusHighlightEnabled(); AX_EXPORT bool IsAccessibilityFocusHighlightEnabled();
#if defined(OS_WIN)
// Enables an experimental Chrome-specific accessibility COM API
AX_EXPORT extern const base::Feature kIChromeAccessible;
// Returns true if the IChromeAccessible COM API is enabled.
AX_EXPORT bool IsIChromeAccessibleEnabled();
#endif // defined(OS_WIN)
} // namespace features } // namespace features
#endif // UI_ACCESSIBILITY_ACCESSIBILITY_FEATURES_H_ #endif // UI_ACCESSIBILITY_ACCESSIBILITY_FEATURES_H_
# Copyright 2020 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import("//build/config/features.gni")
import("//build/config/jumbo.gni")
import("//build/config/linux/pkg_config.gni")
import("//build/config/ui.gni")
import("//mojo/public/tools/bindings/mojom.gni")
import("//testing/libfuzzer/fuzzer_test.gni")
import("//testing/test.gni")
import("//tools/json_schema_compiler/json_schema_api.gni")
import("//ui/base/ui_features.gni")
if (is_win) {
import("//build/toolchain/win/midl.gni")
}
if (is_win) {
midl("ichromeaccessible") {
sources = [ "ichromeaccessible.idl" ]
}
}
...@@ -15,11 +15,14 @@ ...@@ -15,11 +15,14 @@
#include <utility> #include <utility>
#include <vector> #include <vector>
#include "base/json/json_writer.h"
#include "base/lazy_instance.h" #include "base/lazy_instance.h"
#include "base/metrics/histogram_functions.h" #include "base/metrics/histogram_functions.h"
#include "base/strings/string_number_conversions.h" #include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h" #include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h" #include "base/strings/utf_string_conversions.h"
#include "base/threading/thread_task_runner_handle.h"
#include "base/values.h"
#include "base/win/enum_variant.h" #include "base/win/enum_variant.h"
#include "base/win/scoped_bstr.h" #include "base/win/scoped_bstr.h"
#include "base/win/scoped_safearray.h" #include "base/win/scoped_safearray.h"
...@@ -4397,6 +4400,71 @@ IFACEMETHODIMP AXPlatformNodeWin::ShowContextMenu() { ...@@ -4397,6 +4400,71 @@ IFACEMETHODIMP AXPlatformNodeWin::ShowContextMenu() {
return S_OK; return S_OK;
} }
//
// IChromeAccessible implementation.
//
void SendBulkFetchResponse(
Microsoft::WRL::ComPtr<IChromeAccessibleDelegate> delegate,
LONG request_id,
std::string json_result) {
base::string16 json_result_utf16 = base::UTF8ToUTF16(json_result);
delegate->put_bulkFetchResult(request_id,
SysAllocString(json_result_utf16.c_str()));
}
IFACEMETHODIMP AXPlatformNodeWin::get_bulkFetch(
BSTR input_json,
LONG request_id,
IChromeAccessibleDelegate* delegate) {
COM_OBJECT_VALIDATE();
if (!delegate)
return E_INVALIDARG;
// TODO(crbug.com/1083834): if parsing |input_json|, use
// DataDecoder because the json is untrusted. For now, this is just
// a stub that calls PostTask so that it's async, but it doesn't
// actually parse the input.
base::Value result(base::Value::Type::DICTIONARY);
result.SetKey("role", base::Value(ui::ToString(GetData().role)));
gfx::Rect bounds = GetDelegate()->GetBoundsRect(
AXCoordinateSystem::kScreenDIPs, AXClippingBehavior::kUnclipped);
result.SetKey("x", base::Value(bounds.x()));
result.SetKey("y", base::Value(bounds.y()));
result.SetKey("width", base::Value(bounds.width()));
result.SetKey("height", base::Value(bounds.height()));
std::string json_result;
base::JSONWriter::Write(result, &json_result);
base::ThreadTaskRunnerHandle::Get()->PostTask(
FROM_HERE,
base::BindOnce(
&SendBulkFetchResponse,
Microsoft::WRL::ComPtr<IChromeAccessibleDelegate>(delegate),
request_id, json_result));
return S_OK;
}
IFACEMETHODIMP AXPlatformNodeWin::get_hitTest(
LONG screen_physical_pixel_x,
LONG screen_physical_pixel_y,
LONG request_id,
IChromeAccessibleDelegate* delegate) {
COM_OBJECT_VALIDATE();
if (!delegate)
return E_INVALIDARG;
// TODO(crbug.com/1083834): Plumb through an actual async hit test.
AXPlatformNodeWin* hit_child = static_cast<AXPlatformNodeWin*>(
FromNativeViewAccessible(GetDelegate()->HitTestSync(
screen_physical_pixel_x, screen_physical_pixel_y)));
delegate->put_hitTestResult(request_id, static_cast<IAccessible*>(hit_child));
return S_OK;
}
// //
// IServiceProvider implementation. // IServiceProvider implementation.
// //
...@@ -4423,6 +4491,12 @@ IFACEMETHODIMP AXPlatformNodeWin::QueryService(REFGUID guidService, ...@@ -4423,6 +4491,12 @@ IFACEMETHODIMP AXPlatformNodeWin::QueryService(REFGUID guidService,
return QueryInterface(riid, object); return QueryInterface(riid, object);
} }
if (guidService == IID_IChromeAccessible) {
if (features::IsIChromeAccessibleEnabled()) {
return QueryInterface(riid, object);
}
}
// TODO(suproteem): Include IAccessibleEx in the list, potentially checking // TODO(suproteem): Include IAccessibleEx in the list, potentially checking
// for version. // for version.
...@@ -4461,6 +4535,10 @@ STDMETHODIMP AXPlatformNodeWin::InternalQueryInterface( ...@@ -4461,6 +4535,10 @@ STDMETHODIMP AXPlatformNodeWin::InternalQueryInterface(
if (!accessible->GetData().IsRangeValueSupported()) { if (!accessible->GetData().IsRangeValueSupported()) {
return E_NOINTERFACE; return E_NOINTERFACE;
} }
} else if (riid == IID_IChromeAccessible) {
if (!features::IsIChromeAccessibleEnabled()) {
return E_NOINTERFACE;
}
} }
return CComObjectRootBase::InternalQueryInterface(this_ptr, entries, riid, return CComObjectRootBase::InternalQueryInterface(this_ptr, entries, riid,
......
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
#include "ui/accessibility/ax_text_utils.h" #include "ui/accessibility/ax_text_utils.h"
#include "ui/accessibility/platform/ax_platform_node_base.h" #include "ui/accessibility/platform/ax_platform_node_base.h"
#include "ui/accessibility/platform/ax_platform_text_boundary.h" #include "ui/accessibility/platform/ax_platform_text_boundary.h"
#include "ui/accessibility/platform/ichromeaccessible.h"
#include "ui/gfx/range/range.h" #include "ui/gfx/range/range.h"
// IMPORTANT! // IMPORTANT!
...@@ -358,6 +359,7 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2")) ...@@ -358,6 +359,7 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
public IToggleProvider, public IToggleProvider,
public IValueProvider, public IValueProvider,
public IWindowProvider, public IWindowProvider,
public IChromeAccessible,
public AXPlatformNodeBase { public AXPlatformNodeBase {
using IDispatchImpl::Invoke; using IDispatchImpl::Invoke;
...@@ -381,6 +383,7 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2")) ...@@ -381,6 +383,7 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
COM_INTERFACE_ENTRY(IAccessibleTable2) COM_INTERFACE_ENTRY(IAccessibleTable2)
COM_INTERFACE_ENTRY(IAccessibleTableCell) COM_INTERFACE_ENTRY(IAccessibleTableCell)
COM_INTERFACE_ENTRY(IAccessibleValue) COM_INTERFACE_ENTRY(IAccessibleValue)
COM_INTERFACE_ENTRY(IChromeAccessible)
COM_INTERFACE_ENTRY(IExpandCollapseProvider) COM_INTERFACE_ENTRY(IExpandCollapseProvider)
COM_INTERFACE_ENTRY(IGridItemProvider) COM_INTERFACE_ENTRY(IGridItemProvider)
COM_INTERFACE_ENTRY(IGridProvider) COM_INTERFACE_ENTRY(IGridProvider)
...@@ -1020,6 +1023,19 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2")) ...@@ -1020,6 +1023,19 @@ class AX_EXPORT __declspec(uuid("26f5641a-246d-457b-a96d-07f3fae6acf2"))
IFACEMETHODIMP ShowContextMenu() override; IFACEMETHODIMP ShowContextMenu() override;
//
// IChromeAccessible methods.
//
IFACEMETHODIMP get_bulkFetch(BSTR input_json,
LONG request_id,
IChromeAccessibleDelegate* delegate) override;
IFACEMETHODIMP get_hitTest(LONG screen_physical_pixel_x,
LONG screen_physical_pixel_y,
LONG request_id,
IChromeAccessibleDelegate* delegate) override;
// //
// IServiceProvider methods. // IServiceProvider methods.
// //
......
...@@ -11,8 +11,11 @@ ...@@ -11,8 +11,11 @@
#include <memory> #include <memory>
#include "base/auto_reset.h" #include "base/auto_reset.h"
#include "base/json/json_reader.h"
#include "base/run_loop.h"
#include "base/stl_util.h" #include "base/stl_util.h"
#include "base/test/metrics/histogram_tester.h" #include "base/test/metrics/histogram_tester.h"
#include "base/test/task_environment.h"
#include "base/win/atl.h" #include "base/win/atl.h"
#include "base/win/scoped_bstr.h" #include "base/win/scoped_bstr.h"
#include "base/win/scoped_safearray.h" #include "base/win/scoped_safearray.h"
...@@ -20,6 +23,7 @@ ...@@ -20,6 +23,7 @@
#include "testing/gmock/include/gmock/gmock-matchers.h" #include "testing/gmock/include/gmock/gmock-matchers.h"
#include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest/include/gtest/gtest.h"
#include "third_party/iaccessible2/ia2_api_all.h" #include "third_party/iaccessible2/ia2_api_all.h"
#include "ui/accessibility/accessibility_features.h"
#include "ui/accessibility/ax_enums.mojom.h" #include "ui/accessibility/ax_enums.mojom.h"
#include "ui/accessibility/ax_node_data.h" #include "ui/accessibility/ax_node_data.h"
#include "ui/accessibility/platform/ax_fragment_root_win.h" #include "ui/accessibility/platform/ax_fragment_root_win.h"
...@@ -219,7 +223,10 @@ ScopedVariant SELF(CHILDID_SELF); ...@@ -219,7 +223,10 @@ ScopedVariant SELF(CHILDID_SELF);
testing::UnorderedElementsAreArray(expected_property_values)); \ testing::UnorderedElementsAreArray(expected_property_values)); \
} }
AXPlatformNodeWinTest::AXPlatformNodeWinTest() {} AXPlatformNodeWinTest::AXPlatformNodeWinTest() {
scoped_feature_list_.InitAndEnableFeature(features::kIChromeAccessible);
}
AXPlatformNodeWinTest::~AXPlatformNodeWinTest() {} AXPlatformNodeWinTest::~AXPlatformNodeWinTest() {}
void AXPlatformNodeWinTest::SetUp() { void AXPlatformNodeWinTest::SetUp() {
...@@ -6723,4 +6730,120 @@ TEST_F(AXPlatformNodeWinTest, SanitizeStringAttributeForIA2) { ...@@ -6723,4 +6730,120 @@ TEST_F(AXPlatformNodeWinTest, SanitizeStringAttributeForIA2) {
EXPECT_EQ("\\\\\\:\\=\\,\\;", output); EXPECT_EQ("\\\\\\:\\=\\,\\;", output);
} }
//
// IChromeAccessible tests
//
class TestIChromeAccessibleDelegate
: public CComObjectRootEx<CComMultiThreadModel>,
public IDispatchImpl<IChromeAccessibleDelegate> {
using IDispatchImpl::Invoke;
public:
BEGIN_COM_MAP(TestIChromeAccessibleDelegate)
COM_INTERFACE_ENTRY(IChromeAccessibleDelegate)
END_COM_MAP()
TestIChromeAccessibleDelegate() = default;
~TestIChromeAccessibleDelegate() = default;
std::string WaitForBulkFetchResult(LONG expected_request_id) {
if (bulk_fetch_result_.empty())
WaitUsingRunLoop();
CHECK_EQ(expected_request_id, request_id_);
return bulk_fetch_result_;
}
IUnknown* WaitForHitTestResult(LONG expected_request_id) {
if (!hit_test_result_)
WaitUsingRunLoop();
CHECK_EQ(expected_request_id, request_id_);
return hit_test_result_.Get();
}
private:
void WaitUsingRunLoop() {
base::RunLoop run_loop;
run_loop_quit_closure_ = run_loop.QuitClosure();
run_loop.Run();
}
IFACEMETHODIMP put_bulkFetchResult(LONG request_id, BSTR result) override {
bulk_fetch_result_ = base::WideToUTF8(result);
request_id_ = request_id;
if (run_loop_quit_closure_)
run_loop_quit_closure_.Run();
return S_OK;
}
IFACEMETHODIMP put_hitTestResult(LONG request_id, IUnknown* result) override {
hit_test_result_ = result;
request_id_ = request_id;
if (run_loop_quit_closure_)
run_loop_quit_closure_.Run();
return S_OK;
}
std::string bulk_fetch_result_;
ComPtr<IUnknown> hit_test_result_;
LONG request_id_ = 0;
base::RepeatingClosure run_loop_quit_closure_;
};
TEST_F(AXPlatformNodeWinTest, BulkFetch) {
base::test::SingleThreadTaskEnvironment task_environment;
AXNodeData root;
root.id = 1;
root.role = ax::mojom::Role::kScrollBar;
Init(root);
ComPtr<IChromeAccessible> chrome_accessible =
QueryInterfaceFromNode<IChromeAccessible>(GetRootAsAXNode());
CComObject<TestIChromeAccessibleDelegate>* delegate = nullptr;
ASSERT_HRESULT_SUCCEEDED(
CComObject<TestIChromeAccessibleDelegate>::CreateInstance(&delegate));
ScopedBstr input_bstr(L"Potato");
chrome_accessible->get_bulkFetch(input_bstr.Get(), 99, delegate);
std::string response = delegate->WaitForBulkFetchResult(99);
// Note: base::JSONReader is fine for unit tests, but production code
// that parses untrusted JSON should always use DataDecoder instead.
base::JSONReader reader;
base::Optional<base::Value> result =
reader.Read(response, base::JSON_ALLOW_TRAILING_COMMAS);
ASSERT_TRUE(result);
ASSERT_TRUE(result->FindKey("role"));
ASSERT_EQ("scrollBar", result->FindKey("role")->GetString());
}
TEST_F(AXPlatformNodeWinTest, AsyncHitTest) {
base::test::SingleThreadTaskEnvironment task_environment;
AXNodeData root;
root.id = 50;
root.role = ax::mojom::Role::kArticle;
root.relative_bounds.bounds = gfx::RectF(0, 0, 800, 600);
Init(root);
ComPtr<IChromeAccessible> chrome_accessible =
QueryInterfaceFromNode<IChromeAccessible>(GetRootAsAXNode());
CComObject<TestIChromeAccessibleDelegate>* delegate = nullptr;
ASSERT_HRESULT_SUCCEEDED(
CComObject<TestIChromeAccessibleDelegate>::CreateInstance(&delegate));
ScopedBstr input_bstr(L"Potato");
chrome_accessible->get_hitTest(400, 300, 12345, delegate);
ComPtr<IUnknown> result = delegate->WaitForHitTestResult(12345);
ComPtr<IAccessible2> accessible = ToIAccessible2(result);
LONG result_unique_id = 0;
ASSERT_HRESULT_SUCCEEDED(accessible->get_uniqueID(&result_unique_id));
ComPtr<IAccessible2> root_accessible =
QueryInterfaceFromNode<IAccessible2>(GetRootAsAXNode());
LONG root_unique_id = 0;
ASSERT_HRESULT_SUCCEEDED(root_accessible->get_uniqueID(&root_unique_id));
ASSERT_EQ(root_unique_id, result_unique_id);
}
} // namespace ui } // namespace ui
...@@ -10,6 +10,7 @@ ...@@ -10,6 +10,7 @@
#include <memory> #include <memory>
#include <unordered_set> #include <unordered_set>
#include "base/test/scoped_feature_list.h"
#include "ui/accessibility/platform/ax_fragment_root_delegate_win.h" #include "ui/accessibility/platform/ax_fragment_root_delegate_win.h"
#include "ui/base/win/accessibility_misc_utils.h" #include "ui/base/win/accessibility_misc_utils.h"
...@@ -98,6 +99,8 @@ class AXPlatformNodeWinTest : public AXPlatformNodeTest { ...@@ -98,6 +99,8 @@ class AXPlatformNodeWinTest : public AXPlatformNodeTest {
std::unique_ptr<AXFragmentRootWin> ax_fragment_root_; std::unique_ptr<AXFragmentRootWin> ax_fragment_root_;
std::unique_ptr<TestFragmentRootDelegate> test_fragment_root_delegate_; std::unique_ptr<TestFragmentRootDelegate> test_fragment_root_delegate_;
base::test::ScopedFeatureList scoped_feature_list_;
}; };
} // namespace ui } // namespace ui
......
// Copyright 2020 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import "objidl.idl";
import "oaidl.idl";
const long DISPID_CHROME_BULK_FETCH = -1600;
const long DISPID_CHROME_ON_BULK_FETCH_RESULT = -1601;
const long DISPID_CHROME_HIT_TEST = -1602;
const long DISPID_CHROME_ON_HIT_TEST_RESULT = -1603;
// Interface to be implemented by the client that calls IChromeAccessible.
// For every method in IChromeAccessible, there's a corresponding response
// method in IChromeAccessibleDelegate.
[object, uuid(0e3edc14-79f4-413f-b854-d3b6860d74a2), pointer_default(unique)]
interface IChromeAccessibleDelegate : IUnknown
{
[propput, id(DISPID_CHROME_ON_BULK_FETCH_RESULT)] HRESULT bulkFetchResult(
[in] LONG requestID,
[in] BSTR resultJson
);
[propput, id(DISPID_CHROME_ON_HIT_TEST_RESULT)] HRESULT hitTestResult(
[in] LONG requestID,
[in] IUnknown* result
);
};
// Chrome-specific interface exposed on every IAccessible object.
//
// This interface is EXPERIMENTAL and only available behind a flag.
// Run Chrome with --enable-features=IChromeAccessible to use it.
//
// Do not depend on this interface remaining stable! It's only designed
// for prototyping ideas, and anything that's stabilized should move to
// an open standard API.
[object, uuid(6175bd95-3b2e-4ebc-bc51-9cab782bec92), pointer_default(unique)]
interface IChromeAccessible : IUnknown
{
// TODO(crbug.com/1083834): Fully document this interface.
// Fetch multiple accessibility properties of one or more accessibility
// nodes as JSON. This method is asynchronous; the result is returned
// by calling put_bulkFetchResult on |delegate|. The client can pass any
// valid LONG as requestID and the same value will be passed to
// put_bulkFetchResult to enable matching of requests and responses.
[propget, id(DISPID_CHROME_BULK_FETCH)] HRESULT bulkFetch(
[in] BSTR inputJson,
[in] LONG requestID,
[in] IChromeAccessibleDelegate* delegate
);
// Hit-test the given pixel in screen physical pixel coordinates.
// This method is asynchronous; the result is returned
// by calling put_hitTestResult on |delegate|. The client can pass any
// valid LONG as requestID and the same value will be passed to
// put_hitTestResult to enable matching of requests and responses.
[propget, id(DISPID_CHROME_HIT_TEST)] HRESULT hitTest(
[in] LONG screenPhysicalPixelX,
[in] LONG screenPhysicalPixelY,
[in] LONG requestID,
[in] IChromeAccessibleDelegate* delegate
);
};
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment