Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Side by Side Diff: chrome/renderer/resources/extensions/automation/automation_node.js

Issue 2900803003: Automation API hit test should automatically convert to integer coordinates. (Closed)
Patch Set: Created 3 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/automation/sites/hit_test.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 380 matching lines...) Expand 10 before | Expand all | Expand 10 after
391 getImageData: function(maxWidth, maxHeight) { 391 getImageData: function(maxWidth, maxHeight) {
392 this.performAction_('getImageData', 392 this.performAction_('getImageData',
393 { maxWidth: maxWidth, 393 { maxWidth: maxWidth,
394 maxHeight: maxHeight }); 394 maxHeight: maxHeight });
395 }, 395 },
396 396
397 hitTest: function(x, y, eventToFire) { 397 hitTest: function(x, y, eventToFire) {
398 // Convert from global to tree-relative coordinates. 398 // Convert from global to tree-relative coordinates.
399 var location = GetLocation(this.treeID, GetRootID(this.treeID)); 399 var location = GetLocation(this.treeID, GetRootID(this.treeID));
400 this.performAction_('hitTest', 400 this.performAction_('hitTest',
401 { x: x - location.left, 401 { x: Math.floor(x - location.left),
402 y: y - location.top, 402 y: Math.floor(y - location.top),
403 eventToFire: eventToFire }); 403 eventToFire: eventToFire });
404 }, 404 },
405 405
406 makeVisible: function() { 406 makeVisible: function() {
407 this.performAction_('makeVisible'); 407 this.performAction_('makeVisible');
408 }, 408 },
409 409
410 resumeMedia: function() { 410 resumeMedia: function() {
411 this.performAction_('resumeMedia'); 411 this.performAction_('resumeMedia');
412 }, 412 },
(...skipping 753 matching lines...) Expand 10 before | Expand all | Expand 10 after
1166 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) { 1166 utils.defineProperty(AutomationRootNode, 'getOrCreate', function(treeID) {
1167 return AutomationRootNodeImpl.getOrCreate(treeID); 1167 return AutomationRootNodeImpl.getOrCreate(treeID);
1168 }); 1168 });
1169 1169
1170 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) { 1170 utils.defineProperty(AutomationRootNode, 'destroy', function(treeID) {
1171 AutomationRootNodeImpl.destroy(treeID); 1171 AutomationRootNodeImpl.destroy(treeID);
1172 }); 1172 });
1173 1173
1174 exports.$set('AutomationNode', AutomationNode); 1174 exports.$set('AutomationNode', AutomationNode);
1175 exports.$set('AutomationRootNode', AutomationRootNode); 1175 exports.$set('AutomationRootNode', AutomationRootNode);
OLDNEW
« no previous file with comments | « no previous file | chrome/test/data/extensions/api_test/automation/sites/hit_test.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698