| 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 402 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 }, | 413 }, |
| 414 | 414 |
| 415 stopDuckingMedia: function() { | 415 stopDuckingMedia: function() { |
| 416 this.performAction_('stopDuckingMedia'); | 416 this.performAction_('stopDuckingMedia'); |
| 417 }, | 417 }, |
| 418 | 418 |
| 419 suspendMedia: function() { | 419 suspendMedia: function() { |
| 420 this.performAction_('suspendMedia'); | 420 this.performAction_('suspendMedia'); |
| 421 }, | 421 }, |
| 422 | 422 |
| 423 toggleDarkenScreen: function(toggle) { |
| 424 this.performAction_('toggleDarkenScreen', { darkenScreen: toggle }); |
| 425 }, |
| 426 |
| 423 domQuerySelector: function(selector, callback) { | 427 domQuerySelector: function(selector, callback) { |
| 424 if (!this.rootImpl) | 428 if (!this.rootImpl) |
| 425 callback(); | 429 callback(); |
| 426 automationInternal.querySelector( | 430 automationInternal.querySelector( |
| 427 { treeID: this.rootImpl.treeID, | 431 { treeID: this.rootImpl.treeID, |
| 428 automationNodeID: this.id, | 432 automationNodeID: this.id, |
| 429 selector: selector }, | 433 selector: selector }, |
| 430 $Function.bind(this.domQuerySelectorCallback_, this, callback)); | 434 $Function.bind(this.domQuerySelectorCallback_, this, callback)); |
| 431 }, | 435 }, |
| 432 | 436 |
| (...skipping 677 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1110 'htmlAttributes', | 1114 'htmlAttributes', |
| 1111 'nameFrom', | 1115 'nameFrom', |
| 1112 ]), | 1116 ]), |
| 1113 }); | 1117 }); |
| 1114 | 1118 |
| 1115 function AutomationRootNode() { | 1119 function AutomationRootNode() { |
| 1116 privates(AutomationRootNode).constructPrivate(this, arguments); | 1120 privates(AutomationRootNode).constructPrivate(this, arguments); |
| 1117 } | 1121 } |
| 1118 utils.expose(AutomationRootNode, AutomationRootNodeImpl, { | 1122 utils.expose(AutomationRootNode, AutomationRootNodeImpl, { |
| 1119 superclass: AutomationNode, | 1123 superclass: AutomationNode, |
| 1124 functions: [ |
| 1125 'toggleDarkenScreen' |
| 1126 ], |
| 1120 readonly: [ | 1127 readonly: [ |
| 1121 'chromeChannel', | 1128 'chromeChannel', |
| 1122 'docTitle', | 1129 'docTitle', |
| 1123 'docUrl', | 1130 'docUrl', |
| 1124 'docLoaded', | 1131 'docLoaded', |
| 1125 'docLoadingProgress', | 1132 'docLoadingProgress', |
| 1126 'anchorObject', | 1133 'anchorObject', |
| 1127 'anchorOffset', | 1134 'anchorOffset', |
| 1128 'anchorAffinity', | 1135 'anchorAffinity', |
| 1129 'focusObject', | 1136 'focusObject', |
| 1130 'focusOffset', | 1137 'focusOffset', |
| 1131 'focusAffinity', | 1138 'focusAffinity', |
| 1132 ], | 1139 ], |
| 1133 }); | 1140 }); |
| 1134 | 1141 |
| 1135 utils.defineProperty(AutomationRootNode, 'get', function(treeID) { | 1142 utils.defineProperty(AutomationRootNode, 'get', function(treeID) { |
| 1136 return AutomationRootNodeImpl.get(treeID); | 1143 return AutomationRootNodeImpl.get(treeID); |
| 1137 }); | 1144 }); |
| 1138 | 1145 |
| 1139 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { | 1146 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { |
| 1140 return AutomationRootNodeImpl.getOrCreate(treeID); | 1147 return AutomationRootNodeImpl.getOrCreate(treeID); |
| 1141 }); | 1148 }); |
| 1142 | 1149 |
| 1143 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { | 1150 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { |
| 1144 AutomationRootNodeImpl.destroy(treeID); | 1151 AutomationRootNodeImpl.destroy(treeID); |
| 1145 }); | 1152 }); |
| 1146 | 1153 |
| 1147 exports.$set('AutomationNode', AutomationNode); | 1154 exports.$set('AutomationNode', AutomationNode); |
| 1148 exports.$set('AutomationRootNode', AutomationRootNode); | 1155 exports.$set('AutomationRootNode', AutomationRootNode); |
| OLD | NEW |