blob: c396eb063f3331d7b00b2152b259ec654638d0ea [file] [log] [blame]
// Copyright 2014 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.
// This is the implementation layer of the chrome.automation API, and is
// essentially a translation of the internal accessibility tree update system
// into an extension API.
namespace automationInternal {
dictionary Rect {
long left;
long top;
long width;
long height;
};
// A compact representation of the accessibility information for a
// single web object, in a form that can be serialized and sent from
// one process to another.
// See ui/accessibility/ax_node_data.h
dictionary AXNodeData {
long id;
DOMString role;
object state;
Rect location;
object? boolAttributes;
object? floatAttributes;
object? htmlAttributes;
object? intAttributes;
object? intlistAttributes;
object? stringAttributes;
long[] childIds;
};
// Data for an accessibility event and/or an atomic change to an accessibility
// tree. See ui/accessibility/ax_tree_update.h for an extended explanation of
// the tree update format.
dictionary AXEventParams {
// The process id of the renderer host.
long processID;
// The routing id of the web contents that this update is for.
long routingID;
// ID of the node that the event applies to.
long targetID;
// The type of event that this update represents.
DOMString eventType;
// A vector of nodes to update according to the rules described in
// ui/ax_tree_update.h.
AXNodeData[] nodes;
};
// All possible actions that can be performed on automation nodes.
enum ActionType {
focus,
doDefault,
makeVisible,
setSelection
};
// Arguments required for all actions supplied to performAction.
dictionary PerformActionRequiredParams {
long processID;
long routingID;
long automationNodeID;
ActionType actionType;
};
// Arguments for the set_selection action supplied to performAction.
dictionary SetSelectionParams {
long startIndex;
long endIndex;
};
// Returns the process id and routing id of the tab whose accessibility was
// enabled using enable().
callback EnableTabCallback = void(long processID, long routingID);
// Callback called when enableDesktop() returns.
callback EnableDesktopCallback = void();
interface Functions {
// Enable automation of the active tab and retrieves its routing id for use
// in future updates.
static void enableCurrentTab(EnableTabCallback callback);
// Enables desktop automation.
static void enableDesktop(EnableDesktopCallback callback);
// Performs an action on an automation node.
static void performAction(PerformActionRequiredParams args,
object opt_args);
};
interface Events {
// Fired when an accessibility event occurs
static void onAccessibilityEvent(AXEventParams update);
};
};