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

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

Issue 2650733002: Revert of Update json_schema_compiler to handle the Automation extension API (Closed)
Patch Set: Created 3 years, 11 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/tabs_automation_handler.js
diff --git a/chrome/browser/resources/chromeos/chromevox/cvox2/background/tabs_automation_handler.js b/chrome/browser/resources/chromeos/chromevox/cvox2/background/tabs_automation_handler.js
index 0e2365608fe4ed1dc545049ed154990879bf517c..836c23c51f43ff1f7145c023806a45bca479501f 100644
--- a/chrome/browser/resources/chromeos/chromevox/cvox2/background/tabs_automation_handler.js
+++ b/chrome/browser/resources/chromeos/chromevox/cvox2/background/tabs_automation_handler.js
@@ -8,13 +8,11 @@
goog.provide('TabsAutomationHandler');
-goog.require('CustomAutomationEvent');
goog.require('DesktopAutomationHandler');
goog.scope(function() {
var EventType = chrome.automation.EventType;
var RoleType = chrome.automation.RoleType;
-var StateType = chrome.automation.StateType;
/**
* @param {!chrome.automation.AutomationNode} tabRoot
@@ -24,14 +22,14 @@
TabsAutomationHandler = function(tabRoot) {
DesktopAutomationHandler.call(this, tabRoot);
- if (tabRoot.role != RoleType.ROOT_WEB_AREA)
+ if (tabRoot.role != RoleType.rootWebArea)
throw new Error('Expected rootWebArea node but got ' + tabRoot.role);
// When the root is focused, simulate what happens on a load complete.
- if (tabRoot.state[StateType.FOCUSED]) {
- var event = new CustomAutomationEvent(
- EventType.LOAD_COMPLETE, tabRoot, 'page');
- this.onLoadComplete(event);
+ if (tabRoot.state.focused) {
+ this.onLoadComplete(
+ new chrome.automation.AutomationEvent(EventType.loadComplete, tabRoot,
+ 'page'));
}
};
@@ -46,9 +44,8 @@
/** @override */
onLoadComplete: function(evt) {
var focused = evt.target.find({state: {focused: true}}) || evt.target;
- var event = new CustomAutomationEvent(
- EventType.FOCUS, focused, evt.eventFrom);
- this.onFocus(event);
+ this.onFocus(new chrome.automation.AutomationEvent(
+ EventType.focus, focused, evt.eventFrom));
}
};

Powered by Google App Engine
This is Rietveld 408576698