mirror of
https://bitbucket.org/chromiumembedded/cef
synced 2025-06-05 21:39:12 +02:00
Implement accessibility enhancements (issue #1217)
- Add new CefBrowserHost::SetAccessibilityState method for toggling accessibility state when readers are detected by the client. - Add new CefAccessibilityHandler interface for the delivery of accessibility notifications to windowless (OSR) clients. - Fix delivery of CefFocusHandler callbacks to windowless clients. - cefclient: Add example windowless accessibility implementation on Windows and macOS. - cefclient: Automatically detect screen readers on Windows and macOS.
This commit is contained in:
committed by
Marshall Greenblatt
parent
64fcfa6068
commit
816f700d3e
81
libcef_dll/cpptoc/accessibility_handler_cpptoc.cc
Normal file
81
libcef_dll/cpptoc/accessibility_handler_cpptoc.cc
Normal file
@ -0,0 +1,81 @@
|
||||
// Copyright (c) 2017 The Chromium Embedded Framework Authors. All rights
|
||||
// reserved. Use of this source code is governed by a BSD-style license that
|
||||
// can be found in the LICENSE file.
|
||||
//
|
||||
// ---------------------------------------------------------------------------
|
||||
//
|
||||
// This file was generated by the CEF translator tool. If making changes by
|
||||
// hand only do so within the body of existing method and function
|
||||
// implementations. See the translator.README.txt file in the tools directory
|
||||
// for more information.
|
||||
//
|
||||
|
||||
#include "libcef_dll/cpptoc/accessibility_handler_cpptoc.h"
|
||||
#include "libcef_dll/ctocpp/value_ctocpp.h"
|
||||
|
||||
|
||||
namespace {
|
||||
|
||||
// MEMBER FUNCTIONS - Body may be edited by hand.
|
||||
|
||||
void CEF_CALLBACK accessibility_handler_on_accessibility_tree_change(
|
||||
struct _cef_accessibility_handler_t* self, struct _cef_value_t* value) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: value; type: refptr_diff
|
||||
DCHECK(value);
|
||||
if (!value)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefAccessibilityHandlerCppToC::Get(self)->OnAccessibilityTreeChange(
|
||||
CefValueCToCpp::Wrap(value));
|
||||
}
|
||||
|
||||
void CEF_CALLBACK accessibility_handler_on_accessibility_location_change(
|
||||
struct _cef_accessibility_handler_t* self, struct _cef_value_t* value) {
|
||||
// AUTO-GENERATED CONTENT - DELETE THIS COMMENT BEFORE MODIFYING
|
||||
|
||||
DCHECK(self);
|
||||
if (!self)
|
||||
return;
|
||||
// Verify param: value; type: refptr_diff
|
||||
DCHECK(value);
|
||||
if (!value)
|
||||
return;
|
||||
|
||||
// Execute
|
||||
CefAccessibilityHandlerCppToC::Get(self)->OnAccessibilityLocationChange(
|
||||
CefValueCToCpp::Wrap(value));
|
||||
}
|
||||
|
||||
} // namespace
|
||||
|
||||
|
||||
// CONSTRUCTOR - Do not edit by hand.
|
||||
|
||||
CefAccessibilityHandlerCppToC::CefAccessibilityHandlerCppToC() {
|
||||
GetStruct()->on_accessibility_tree_change =
|
||||
accessibility_handler_on_accessibility_tree_change;
|
||||
GetStruct()->on_accessibility_location_change =
|
||||
accessibility_handler_on_accessibility_location_change;
|
||||
}
|
||||
|
||||
template<> CefRefPtr<CefAccessibilityHandler> CefCppToCRefCounted<CefAccessibilityHandlerCppToC,
|
||||
CefAccessibilityHandler, cef_accessibility_handler_t>::UnwrapDerived(
|
||||
CefWrapperType type, cef_accessibility_handler_t* s) {
|
||||
NOTREACHED() << "Unexpected class type: " << type;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
#if DCHECK_IS_ON()
|
||||
template<> base::AtomicRefCount CefCppToCRefCounted<CefAccessibilityHandlerCppToC,
|
||||
CefAccessibilityHandler, cef_accessibility_handler_t>::DebugObjCt = 0;
|
||||
#endif
|
||||
|
||||
template<> CefWrapperType CefCppToCRefCounted<CefAccessibilityHandlerCppToC,
|
||||
CefAccessibilityHandler, cef_accessibility_handler_t>::kWrapperType =
|
||||
WT_ACCESSIBILITY_HANDLER;
|
Reference in New Issue
Block a user