chromium/third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.cc

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "third_party/blink/renderer/modules/accessibility/inspector_accessibility_agent.h"

#include <memory>

#include "third_party/blink/renderer/core/accessibility/ax_object_cache.h"
#include "third_party/blink/renderer/core/aom/accessible_node.h"
#include "third_party/blink/renderer/core/dom/dom_node_ids.h"
#include "third_party/blink/renderer/core/dom/element.h"
#include "third_party/blink/renderer/core/dom/flat_tree_traversal.h"
#include "third_party/blink/renderer/core/dom/node.h"
#include "third_party/blink/renderer/core/dom/node_list.h"
#include "third_party/blink/renderer/core/frame/local_frame.h"
#include "third_party/blink/renderer/core/html_names.h"
#include "third_party/blink/renderer/core/inspector/identifiers_factory.h"
#include "third_party/blink/renderer/core/inspector/inspected_frames.h"
#include "third_party/blink/renderer/core/inspector/inspector_dom_agent.h"
#include "third_party/blink/renderer/core/inspector/inspector_style_sheet.h"
#include "third_party/blink/renderer/modules/accessibility/ax_object.h"
#include "third_party/blink/renderer/modules/accessibility/ax_object_cache_impl.h"
#include "third_party/blink/renderer/modules/accessibility/inspector_type_builder_helper.h"
#include "third_party/blink/renderer/platform/wtf/deque.h"
#include "ui/accessibility/ax_enums.mojom-blink.h"
#include "ui/accessibility/ax_mode.h"
#include "ui/accessibility/ax_node_data.h"

namespace blink {

Maybe;
AXNode;
AXNodeId;
AXProperty;
AXPropertyName;
AXRelatedNode;
AXValue;
AXValueSource;
AXValueType;
AXPropertyNameEnum;

namespace {

static const AXID kIDForInspectedNodeWithNoAXNode =;
// Send node updates to the frontend not more often than once within the
// `kNodeSyncThrottlePeriod` time frame.
static const base::TimeDelta kNodeSyncThrottlePeriod =;
// Interval at which we check if there is a need to schedule visual updates.
static const base::TimeDelta kVisualUpdateCheckInterval =;

void AddHasPopupProperty(ax::mojom::blink::HasPopup has_popup,
                         protocol::Array<AXProperty>& properties) {}

void FillLiveRegionProperties(AXObject& ax_object,
                              const ui::AXNodeData& node_data,
                              protocol::Array<AXProperty>& properties) {}

void FillGlobalStates(AXObject& ax_object,
                      const ui::AXNodeData& node_data,
                      protocol::Array<AXProperty>& properties) {}

bool RoleAllowsMultiselectable(ax::mojom::Role role) {}

bool RoleAllowsReadonly(ax::mojom::Role role) {}

bool RoleAllowsRequired(ax::mojom::Role role) {}

void FillWidgetProperties(AXObject& ax_object,
                          const ui::AXNodeData& node_data,
                          protocol::Array<AXProperty>& properties) {}

void FillWidgetStates(AXObject& ax_object,
                      const ui::AXNodeData& node_data,
                      protocol::Array<AXProperty>& properties) {}

std::unique_ptr<AXProperty> CreateRelatedNodeListProperty(
    const String& key,
    AXRelatedObjectVector& nodes) {}

std::unique_ptr<AXProperty> CreateRelatedNodeListProperty(
    const String& key,
    AXObject::AXObjectVector& nodes,
    const QualifiedName& attr,
    AXObject& ax_object) {}

void FillRelationships(AXObject& ax_object,
                       protocol::Array<AXProperty>& properties) {}

void GetObjectsFromAXIDs(const AXObjectCacheImpl& cache,
                         const std::vector<int32_t>& ax_ids,
                         AXObject::AXObjectVector* ax_objects) {}

void FillSparseAttributes(AXObject& ax_object,
                          const ui::AXNodeData& node_data,
                          protocol::Array<AXProperty>& properties) {}

// Creates a role name value that is easy to read by developers. This function
// reduces the granularity of the role and uses ARIA role strings when possible.
std::unique_ptr<AXValue> CreateRoleNameValue(ax::mojom::Role role) {}

// Creates an integer role value that is fixed over releases, is not lossy, and
// is more suitable for machine learning models or automation.
std::unique_ptr<AXValue> CreateInternalRoleValue(ax::mojom::Role role) {}

}  // namespace

EnabledAgentsMultimap;

EnabledAgentsMultimap& EnabledAgents() {}

InspectorAccessibilityAgent::InspectorAccessibilityAgent(
    InspectedFrames* inspected_frames,
    InspectorDOMAgent* dom_agent)
    :{}

protocol::Response InspectorAccessibilityAgent::getPartialAXTree(
    Maybe<int> dom_node_id,
    Maybe<int> backend_node_id,
    Maybe<String> object_id,
    Maybe<bool> fetch_relatives,
    std::unique_ptr<protocol::Array<AXNode>>* nodes) {}

void InspectorAccessibilityAgent::AddAncestors(
    AXObject& first_ancestor,
    AXObject* inspected_ax_object,
    std::unique_ptr<protocol::Array<AXNode>>& nodes,
    AXObjectCacheImpl& cache) const {}

std::unique_ptr<AXNode>
InspectorAccessibilityAgent::BuildProtocolAXNodeForDOMNodeWithNoAXNode(
    int backend_node_id) const {}

std::unique_ptr<AXNode>
InspectorAccessibilityAgent::BuildProtocolAXNodeForAXObject(
    AXObject& ax_object,
    bool force_name_and_role) const {}

std::unique_ptr<AXNode>
InspectorAccessibilityAgent::BuildProtocolAXNodeForIgnoredAXObject(
    AXObject& ax_object,
    bool force_name_and_role) const {}

std::unique_ptr<AXNode>
InspectorAccessibilityAgent::BuildProtocolAXNodeForUnignoredAXObject(
    AXObject& ax_object) const {}

LocalFrame* InspectorAccessibilityAgent::FrameFromIdOrRoot(
    const protocol::Maybe<String>& frame_id) {}

protocol::Response InspectorAccessibilityAgent::getFullAXTree(
    protocol::Maybe<int> depth,
    Maybe<String> frame_id,
    std::unique_ptr<protocol::Array<AXNode>>* nodes) {}

std::unique_ptr<protocol::Array<AXNode>>
InspectorAccessibilityAgent::WalkAXNodesToDepth(Document* document,
                                                int max_depth) {}

protocol::Response InspectorAccessibilityAgent::getRootAXNode(
    Maybe<String> frame_id,
    std::unique_ptr<AXNode>* node) {}

protocol::Response InspectorAccessibilityAgent::getAXNodeAndAncestors(
    Maybe<int> dom_node_id,
    Maybe<int> backend_node_id,
    Maybe<String> object_id,
    std::unique_ptr<protocol::Array<protocol::Accessibility::AXNode>>*
        out_nodes) {}

protocol::Response InspectorAccessibilityAgent::getChildAXNodes(
    const String& in_id,
    Maybe<String> frame_id,
    std::unique_ptr<protocol::Array<protocol::Accessibility::AXNode>>*
        out_nodes) {}

void InspectorAccessibilityAgent::FillCoreProperties(
    AXObject& ax_object,
    AXNode* node_object) const {}

void InspectorAccessibilityAgent::AddChildren(
    AXObject& ax_object,
    bool follow_ignored,
    std::unique_ptr<protocol::Array<AXNode>>& nodes,
    AXObjectCacheImpl& cache) const {}

void InspectorAccessibilityAgent::queryAXTree(
    Maybe<int> dom_node_id,
    Maybe<int> backend_node_id,
    Maybe<String> object_id,
    Maybe<String> accessible_name,
    Maybe<String> role,
    std::unique_ptr<QueryAXTreeCallback> callback) {}

void InspectorAccessibilityAgent::CompleteQuery(AXQuery& query) {}

void InspectorAccessibilityAgent::AXReadyCallback(Document& document) {}

void InspectorAccessibilityAgent::ProcessPendingQueries(Document& document) {}

void InspectorAccessibilityAgent::ProcessPendingDirtyNodes(Document& document) {}

void InspectorAccessibilityAgent::ScheduleAXUpdateIfNeeded(TimerBase*,
                                                           Document* document) {}

void InspectorAccessibilityAgent::ScheduleAXChangeNotification(
    Document* document) {}

void InspectorAccessibilityAgent::AXEventFired(AXObject* ax_object,
                                               ax::mojom::blink::Event event) {}

bool InspectorAccessibilityAgent::MarkAXObjectDirty(AXObject* ax_object) {}

void InspectorAccessibilityAgent::AXObjectModified(AXObject* ax_object,
                                                   bool subtree) {}

void InspectorAccessibilityAgent::EnableAndReset() {}

protocol::Response InspectorAccessibilityAgent::enable() {}

protocol::Response InspectorAccessibilityAgent::disable() {}

void InspectorAccessibilityAgent::Restore() {}

void InspectorAccessibilityAgent::ProvideTo(LocalFrame* frame) {}

AXObjectCacheImpl& InspectorAccessibilityAgent::AttachToAXObjectCache(
    Document* document) {}

void InspectorAccessibilityAgent::Trace(Visitor* visitor) const {}

}  // namespace blink