CefAccessibilityHandler
Header: cef_accessibility_handler.h
Category: Browser Handlers
Overview
User-implemented handler interfaces returned from CefClient and registered with CefBrowserHost.
CefAccessibilityHandler
Source File: include/cef_accessibility_handler.h
Process / Thread Context: Browser Process / UI Thread (class comment: "The
Purpose: User-implemented interface to receive accessibility notifications
Usage Example
cpp
#include "include/cef_accessibility_handler.h"
#include "include/cef_render_handler.h"
#include "include/cef_client.h"
class MyAccessibilityHandler : public CefAccessibilityHandler {
public:
void OnAccessibilityTreeChange(CefRefPtr<CefValue> value) override {
// Inspect |value| (typically a dictionary) and push into the
// platform's accessibility API (UIAutomation / NSAccessibility / AT-SPI).
}
void OnAccessibilityLocationChange(CefRefPtr<CefValue> value) override {
// Update on-screen bounds for accessibility nodes only.
}
IMPLEMENT_REFCOUNTING(MyAccessibilityHandler);
};
// Returned from your CefRenderHandler (not directly from CefClient):
class MyRenderHandler : public CefRenderHandler {
// ... OnPaint, GetViewRect, etc. ...
CefRefPtr<CefAccessibilityHandler> GetAccessibilityHandler() override {
return new MyAccessibilityHandler();
}
};
class MyClient : public CefClient {
public:
CefRefPtr<CefRenderHandler> GetRenderHandler() override {
return new MyRenderHandler();
}
};