class A11yFocusManagerImpl
Defined at line 40 of file ../../src/ui/a11y/lib/screen_reader/focus/a11y_focus_manager_impl.h
The A11yFocusManager keeps track of a11y focus and a cache of the "last
focused node" for each view.
The a11y focus is defined as the semantic node which is selected in a certain
view by the screen reader. There is only (up to) one active a11y focus, meaning that
the screen reader cares only about (up to) one node at a time.
The view in a11y focus and the view in input focus are almost always kept in sync:
- If the system changes the Focus Chain to a different view, the a11y focus
also follows. (If a node was previously focused in that view, it regains
focus, otherwise the a11y focus is lost.)
- If the a11y focus is changed, this will trigger a Focus Chain Update if the
active a11y focus is moving to another view (except in rare situations
involving the virtual keyboard).
(For clarity, the following terms are equivalent: 'view in input focus', 'view in Scenic focus',
and 'view at the end of the focus chain'.)
Public Members
static const uint32_t kRootNodeId
static const char[] kCurrentlyFocusedKoidInspectNodeName
static const char[] kCurrentlyFocusedNodeIdInspectNodeName
Public Methods
void A11yFocusManagerImpl (AccessibilityFocusChainRequester * focus_chain_requester, AccessibilityFocusChainRegistry * registry, ViewSource * view_source, VirtualKeyboardManager * virtual_keyboard_manager, std::shared_ptr<HighlightDelegate> highlight_delegate, inspect::Node inspect_node)
|focus_chain_requester| and |registry| must outlive this object.
|highlight_delegate| must be non-null since we are using Flatland.
Defined at line 17 of file ../../src/ui/a11y/lib/screen_reader/focus/a11y_focus_manager_impl.cc
void ~A11yFocusManagerImpl ()
Defined at line 37 of file ../../src/ui/a11y/lib/screen_reader/focus/a11y_focus_manager_impl.cc
std::optional<A11yFocusInfo> GetA11yFocus ()
|A11yFocusManager|
Returns the current a11y focus, if any.
Defined at line 39 of file ../../src/ui/a11y/lib/screen_reader/focus/a11y_focus_manager_impl.cc
void SetA11yFocus (zx_koid_t koid, uint32_t node_id, SetA11yFocusCallback callback)
|A11yFocusManager|
Tries to set the a11y focus.
If the new focus is in a different view from the current input focus, then
we'll send a focus chain update request to scenic -- unless the new view
contains a visible virtual keyboard.
If the scenic focus chain update succeeds (or was eschewed), we'll
(1) set the a11y focus to {koid, node_id}, (2) redraw highlights, and (3)
call the callback with 'true'.
Otherwise, we'll call the callback with 'false'.
Defined at line 51 of file ../../src/ui/a11y/lib/screen_reader/focus/a11y_focus_manager_impl.cc
void set_on_a11y_focus_updated_callback (OnA11yFocusUpdatedCallback on_a11y_focus_updated_callback)
|A11yFocusManager|
Registers a callback that is invoked when the a11y focus is updated. For now, only one callback
can be registered at a time.
Defined at line 99 of file ../../src/ui/a11y/lib/screen_reader/focus/a11y_focus_manager_impl.h
void RestoreA11yFocusToInputFocus ()
|A11yFocusManager|
Try to restore the a11y focus to the view in input focus, if possible.
After this method completes, GetA11yFocus() will generally return a non-nullopt
value (except in some rare situations).
Defined at line 109 of file ../../src/ui/a11y/lib/screen_reader/focus/a11y_focus_manager_impl.cc
void ClearA11yFocus ()
|A11yFocusManager|
Clears existing a11y focus, and forgets the current view's "last focused node".
Defined at line 180 of file ../../src/ui/a11y/lib/screen_reader/focus/a11y_focus_manager_impl.cc
void RedrawHighlights ()
|A11yFocusManager|
If a node is in a11y focus, redraws the current highlights (useful if the
node's bounding box has changed).
Otherwise, clears any highlights.
Defined at line 191 of file ../../src/ui/a11y/lib/screen_reader/focus/a11y_focus_manager_impl.cc