| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 var AutomationEvent = require('automationEvent').AutomationEvent; | 5 var AutomationEvent = require('automationEvent').AutomationEvent; |
| 6 var automationInternal = | 6 var automationInternal = |
| 7 require('binding').Binding.create('automationInternal').generate(); | 7 require('binding').Binding.create('automationInternal').generate(); |
| 8 var exceptionHandler = require('uncaught_exception_handler'); | 8 var exceptionHandler = require('uncaught_exception_handler'); |
| 9 var IsInteractPermitted = | 9 var IsInteractPermitted = |
| 10 requireNative('automationInternal').IsInteractPermitted; | 10 requireNative('automationInternal').IsInteractPermitted; |
| (...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 376 focus: function() { | 376 focus: function() { |
| 377 this.performAction_('focus'); | 377 this.performAction_('focus'); |
| 378 }, | 378 }, |
| 379 | 379 |
| 380 getImageData: function(maxWidth, maxHeight) { | 380 getImageData: function(maxWidth, maxHeight) { |
| 381 this.performAction_('getImageData', | 381 this.performAction_('getImageData', |
| 382 { maxWidth: maxWidth, | 382 { maxWidth: maxWidth, |
| 383 maxHeight: maxHeight }); | 383 maxHeight: maxHeight }); |
| 384 }, | 384 }, |
| 385 | 385 |
| 386 hitTest: function(x, y, eventToFire) { |
| 387 // Convert from global to tree-relative coordinates. |
| 388 var location = GetLocation(this.treeID, GetRootID(this.treeID)); |
| 389 this.performAction_('hitTest', |
| 390 { x: x - location.left, |
| 391 y: y - location.top, |
| 392 eventToFire: eventToFire }); |
| 393 }, |
| 394 |
| 386 makeVisible: function() { | 395 makeVisible: function() { |
| 387 this.performAction_('makeVisible'); | 396 this.performAction_('makeVisible'); |
| 388 }, | 397 }, |
| 389 | 398 |
| 390 resumeMedia: function() { | 399 resumeMedia: function() { |
| 391 this.performAction_('resumeMedia'); | 400 this.performAction_('resumeMedia'); |
| 392 }, | 401 }, |
| 393 | 402 |
| 394 setSelection: function(startIndex, endIndex) { | 403 setSelection: function(startIndex, endIndex) { |
| 395 if (this.role == 'textField' || this.role == 'textBox') { | 404 if (this.role == 'textField' || this.role == 'textBox') { |
| 396 this.performAction_('setSelection', | 405 this.performAction_('setSelection', |
| 397 { focusNodeID: this.id, | 406 { focusNodeID: this.id, |
| 398 anchorOffset: startIndex, | 407 anchorOffset: startIndex, |
| 399 focusOffset: endIndex }); | 408 focusOffset: endIndex }); |
| 400 } | 409 } |
| (...skipping 670 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1071 function AutomationNode() { | 1080 function AutomationNode() { |
| 1072 privates(AutomationNode).constructPrivate(this, arguments); | 1081 privates(AutomationNode).constructPrivate(this, arguments); |
| 1073 } | 1082 } |
| 1074 utils.expose(AutomationNode, AutomationNodeImpl, { | 1083 utils.expose(AutomationNode, AutomationNodeImpl, { |
| 1075 functions: [ | 1084 functions: [ |
| 1076 'doDefault', | 1085 'doDefault', |
| 1077 'find', | 1086 'find', |
| 1078 'findAll', | 1087 'findAll', |
| 1079 'focus', | 1088 'focus', |
| 1080 'getImageData', | 1089 'getImageData', |
| 1090 'hitTest', |
| 1081 'makeVisible', | 1091 'makeVisible', |
| 1082 'matches', | 1092 'matches', |
| 1083 'resumeMedia', | 1093 'resumeMedia', |
| 1084 'setSelection', | 1094 'setSelection', |
| 1085 'setSequentialFocusNavigationStartingPoint', | 1095 'setSequentialFocusNavigationStartingPoint', |
| 1086 'showContextMenu', | 1096 'showContextMenu', |
| 1087 'startDuckingMedia', | 1097 'startDuckingMedia', |
| 1088 'stopDuckingMedia', | 1098 'stopDuckingMedia', |
| 1089 'suspendMedia', | 1099 'suspendMedia', |
| 1090 'addEventListener', | 1100 'addEventListener', |
| (...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1139 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { | 1149 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { |
| 1140 return AutomationRootNodeImpl.getOrCreate(treeID); | 1150 return AutomationRootNodeImpl.getOrCreate(treeID); |
| 1141 }); | 1151 }); |
| 1142 | 1152 |
| 1143 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { | 1153 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { |
| 1144 AutomationRootNodeImpl.destroy(treeID); | 1154 AutomationRootNodeImpl.destroy(treeID); |
| 1145 }); | 1155 }); |
| 1146 | 1156 |
| 1147 exports.$set('AutomationNode', AutomationNode); | 1157 exports.$set('AutomationNode', AutomationNode); |
| 1148 exports.$set('AutomationRootNode', AutomationRootNode); | 1158 exports.$set('AutomationRootNode', AutomationRootNode); |
| OLD | NEW |