chrome 100 percent

chrome 100 percent


DisciplinaPedagogia116.669 materiais672.644 seguidores
Pré-visualização50 páginas
if ((!automationUtil.focusedNode || eventParams.eventType != 'focus') &&
 !privates(targetTree).impl.onAccessibilityEvent(eventParams))
 return;
 // If we're not waiting on a callback to getTree(), we can early out here.
 if (!(id in idToCallback))
 return;
 // We usually get a 'placeholder' tree first, which doesn't have any url
 // attribute or child nodes. If we've got that, wait for the full tree before
 // calling the callback.
 // TODO(dmazzoni): Don't send down placeholder (crbug.com/397553)
 if (id != DESKTOP_TREE_ID && !targetTree.url &&
 targetTree.children.length == 0)
 return;
 // If the tree wasn't available when getTree() was called, the callback will
 // have been cached in idToCallback, so call and delete it now that we
 // have the complete tree.
 for (var i = 0; i < idToCallback[id].length; i++) {
 var callback = idToCallback[id][i];
 callback(targetTree);
 }
 delete idToCallback[id];
});
automationInternal.onAccessibilityTreeDestroyed.addListener(function(id) {
 // Destroy the AutomationRootNode.
 var targetTree = AutomationRootNode.get(id);
 if (targetTree) {
 privates(targetTree).impl.destroy();
 AutomationRootNode.destroy(id);
 } else {
 logging.WARNING('no targetTree to destroy');
 }
 // Destroy the native cache of the accessibility tree.
 DestroyAccessibilityTree(id);
});
automationInternal.onAccessibilityTreeSerializationError.addListener(
 function(id) {
 automationInternal.enableFrame(id);
});
automationInternal.onActionResult.addListener(
 function(treeID, requestID, result) {
 var targetTree = AutomationRootNode.get(treeID);
 if (!targetTree)
 return;
 privates(targetTree).impl.onActionResult(requestID, result);
 });
if (!apiBridge)
 exports.$set('binding', automation.generate());
// 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.
var utils = require('utils');
function AutomationEventImpl(type, target, eventFrom) {
 this.propagationStopped = false;
 this.type = type;
 this.target = target;
 this.eventPhase = Event.NONE;
 this.eventFrom = eventFrom;
}
AutomationEventImpl.prototype = {
 __proto__: null,
 stopPropagation: function() {
 this.propagationStopped = true;
 },
};
function AutomationEvent() {
 privates(AutomationEvent).constructPrivate(this, arguments);
}
utils.expose(AutomationEvent, AutomationEventImpl, {
 functions: [
 'stopPropagation',
 ],
 readonly: [
 'type',
 'target',
 'eventPhase',
 'eventFrom',
 ],
});
exports.$set('AutomationEvent', AutomationEvent);
// 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.
var AutomationEvent = require('automationEvent').AutomationEvent;
var automationInternal =
 getInternalApi ?
 getInternalApi('automationInternal') :
 require('binding').Binding.create('automationInternal').generate();
var exceptionHandler = require('uncaught_exception_handler');
var natives = requireNative('automationInternal');
var IsInteractPermitted = natives.IsInteractPermitted;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @return {?number} The id of the root node.
 */
var GetRootID = natives.GetRootID;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @return {?string} The title of the document.
 */
var GetDocTitle = natives.GetDocTitle;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @return {?string} The url of the document.
 */
var GetDocURL = natives.GetDocURL;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @return {?boolean} True if the document has finished loading.
 */
var GetDocLoaded = natives.GetDocLoaded;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @return {?number} The loading progress, from 0.0 to 1.0 (fully loaded).
 */
var GetDocLoadingProgress =
 natives.GetDocLoadingProgress;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @return {?number} The ID of the selection anchor object.
 */
var GetAnchorObjectID = natives.GetAnchorObjectID;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @return {?number} The selection anchor offset.
 */
var GetAnchorOffset = natives.GetAnchorOffset;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @return {?string} The selection anchor affinity.
 */
var GetAnchorAffinity = natives.GetAnchorAffinity;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @return {?number} The ID of the selection focus object.
 */
var GetFocusObjectID = natives.GetFocusObjectID;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @return {?number} The selection focus offset.
 */
var GetFocusOffset = natives.GetFocusOffset;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @return {?string} The selection focus affinity.
 */
var GetFocusAffinity = natives.GetFocusAffinity;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @param {number} nodeID The id of a node.
 * @return {?number} The id of the node's parent, or undefined if it's the
 * root of its tree or if the tree or node wasn't found.
 */
var GetParentID = natives.GetParentID;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @param {number} nodeID The id of a node.
 * @return {?number} The number of children of the node, or undefined if
 * the tree or node wasn't found.
 */
var GetChildCount = natives.GetChildCount;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @param {number} nodeID The id of a node.
 * @param {number} childIndex An index of a child of this node.
 * @return {?number} The id of the child at the given index, or undefined
 * if the tree or node or child at that index wasn't found.
 */
var GetChildIDAtIndex = natives.GetChildIDAtIndex;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @param {number} nodeID The id of a node.
 * @return {?number} The ids of the children of the node, or undefined
 * if the tree or node wasn't found.
 */
var GetChildIds = natives.GetChildIDs;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @param {number} nodeID The id of a node.
 * @return {?Object} An object mapping html attributes to values.
 */
var GetHtmlAttributes = natives.GetHtmlAttributes;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @param {number} nodeID The id of a node.
 * @return {?number} The index of this node in its parent, or undefined if
 * the tree or node or node parent wasn't found.
 */
var GetIndexInParent = natives.GetIndexInParent;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @param {number} nodeID The id of a node.
 * @return {?Object} An object with a string key for every state flag set,
 * or undefined if the tree or node or node parent wasn't found.
 */
var GetState = natives.GetState;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @param {number} nodeID The id of a node.
 * @return {string} The restriction, one of
 * &quot;disabled&quot;, &quot;readOnly&quot; or undefined if enabled or other object not disabled
 */
var GetRestriction = natives.GetRestriction;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @param {number} nodeID The id of a node.
 * @return {string} The checked state, as undefined, &quot;true&quot;, &quot;false&quot; or &quot;mixed&quot;.
 */
var GetChecked = natives.GetChecked;
/**
 * @param {number} axTreeID The id of the accessibility tree.
 * @param {number} nodeID The id of a node.
 * @return {string} The role of the