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

Unified Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js

Issue 2601333002: Update json_schema_compiler to handle the Automation extension API (Closed)
Patch Set: Better solution Created 3 years, 12 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
index 2b56429048988d69a4848ee11ffe301adb45f3d3..ec6f3999528e36122b3b35187ae49b6c398b6b8d 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/desktop_automation_handler.js
@@ -72,9 +72,11 @@ DesktopAutomationHandler = function(node) {
return;
if (focus) {
- this.onFocus(
- new chrome.automation.AutomationEvent(
- EventType.focus, focus, 'page'));
+ var event = new chrome.automation.AutomationEvent();
Devlin 2017/01/04 23:54:21 rietveld thinks there's an illegal character here,
+ event.type = EventType.focus;
+ event.target = focus;
+ event.eventFrom = 'page';
+ this.onFocus(event);
}
}).bind(this));
}.bind(this));
@@ -205,8 +207,11 @@ DesktopAutomationHandler.prototype = {
onActiveDescendantChanged: function(evt) {
if (!evt.target.activeDescendant || !evt.target.state.focused)
return;
- this.onEventDefault(new chrome.automation.AutomationEvent(
- EventType.focus, evt.target.activeDescendant, evt.eventFrom));
+ var event = new chrome.automation.AutomationEvent();
+ event.type = EventType.focus;
+ event.target = evt.target.activeDescendant;
+ event.eventFrom = evt.eventFrom;
+ this.onEventDefault(event);
},
/**
@@ -232,9 +237,11 @@ DesktopAutomationHandler.prototype = {
return;
Output.forceModeForNextSpeechUtterance(cvox.QueueMode.CATEGORY_FLUSH);
- this.onEventIfInRange(
- new chrome.automation.AutomationEvent(
- EventType.checkedStateChanged, evt.target, evt.eventFrom));
+ var event = new chrome.automation.AutomationEvent();
+ event.type = EventType.checkedStateChanged;
+ event.target = evt.target;
+ event.eventFrom = evt.eventFrom;
+ this.onEventIfInRange(event);
},
/**
@@ -279,8 +286,11 @@ DesktopAutomationHandler.prototype = {
return;
}
- this.onEventDefault(new chrome.automation.AutomationEvent(
- EventType.focus, node, evt.eventFrom));
+ var event = new chrome.automation.AutomationEvent();
+ event.type = EventType.focus;
+ event.target = node;
+ event.eventFrom = evt.eventFrom;
+ this.onEventDefault(event);
},
/**
@@ -487,9 +497,11 @@ DesktopAutomationHandler.prototype = {
// after you close them.
chrome.automation.getFocus(function(focus) {
if (focus) {
- this.onFocus(
- new chrome.automation.AutomationEvent(
- EventType.focus, focus, 'page'));
+ var event = new chrome.automation.AutomationEvent();
+ event.type = EventType.focus;
+ event.target = focus;
+ event.eventFrom = 'page';
+ this.onFocus(event);
}
}.bind(this));
},

Powered by Google App Engine
This is Rietveld 408576698