| Index: chrome/renderer/resources/extensions/automation_custom_bindings.js
|
| diff --git a/chrome/renderer/resources/extensions/automation_custom_bindings.js b/chrome/renderer/resources/extensions/automation_custom_bindings.js
|
| index ae84e27949fd3baaca5a8ab0f0819b402a5ebc7e..03f3f9a75ae6b70011ae58b8f34698ad68fbd3ad 100644
|
| --- a/chrome/renderer/resources/extensions/automation_custom_bindings.js
|
| +++ b/chrome/renderer/resources/extensions/automation_custom_bindings.js
|
| @@ -127,6 +127,26 @@ automation.registerCustomHook(function(bindingsAPI) {
|
| addTreeChangeObserver(observer);
|
| });
|
|
|
| + apiFunctions.setHandleRequest('setDocumentSelection', function(anchorNode,
|
| + anchorOffset,
|
| + focusNode,
|
| + focusOffset) {
|
| + var anchorNodeImpl = privates(anchorNode).impl;
|
| + var focusNodeImpl = privates(focusNode).impl;
|
| + if (anchorNodeImpl.treeID !== focusNodeImpl.treeID)
|
| + throw new Error('Selection anchor and focus must be in the same tree.');
|
| + if (anchorNodeImpl.treeID === DESKTOP_TREE_ID) {
|
| + throw new Error('Use AutomationNode.setSelection to set the selection ' +
|
| + 'in the desktop tree.');
|
| + }
|
| + automationInternal.performAction({ treeID: anchorNodeImpl.treeID,
|
| + automationNodeID: anchorNodeImpl.id,
|
| + actionType: 'setSelection'},
|
| + { focusNodeID: focusNodeImpl.id,
|
| + anchorOffset: anchorOffset,
|
| + focusOffset: focusOffset });
|
| + });
|
| +
|
| });
|
|
|
| automationInternal.onTreeChange.addListener(function(treeID,
|
|
|