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 bbb2bfa2bf28882b9aee56b546c4bcd796951512..c52648add2888713079e5babc4971cacba620f4c 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 |
@@ -10,6 +10,7 @@ goog.provide('DesktopAutomationHandler'); |
goog.require('AutomationObjectConstructorInstaller'); |
goog.require('BaseAutomationHandler'); |
+goog.require('ChromeVoxAutomationEvent'); |
goog.require('ChromeVoxState'); |
goog.require('Stubs'); |
goog.require('editing.TextEditHandler'); |
@@ -72,9 +73,8 @@ DesktopAutomationHandler = function(node) { |
return; |
if (focus) { |
- this.onFocus( |
- new chrome.automation.AutomationEvent( |
- EventType.focus, focus, 'page')); |
+ this.onFocus(new ChromeVoxAutomationEvent( |
+ EventType.focus, focus, 'page')); |
} |
}).bind(this)); |
}.bind(this)); |
@@ -102,7 +102,7 @@ DesktopAutomationHandler.prototype = { |
/** |
* Provides all feedback once ChromeVox's focus changes. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onEventDefault: function(evt) { |
var node = evt.target; |
@@ -140,7 +140,7 @@ DesktopAutomationHandler.prototype = { |
}, |
/** |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onEventIfInRange: function(evt) { |
if (!this.shouldOutput_(evt)) |
@@ -163,7 +163,7 @@ DesktopAutomationHandler.prototype = { |
}, |
/** |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onEventIfSelected: function(evt) { |
if (evt.target.state.selected) |
@@ -171,7 +171,7 @@ DesktopAutomationHandler.prototype = { |
}, |
/** |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onEventWithFlushedOutput: function(evt) { |
Output.forceModeForNextSpeechUtterance(cvox.QueueMode.FLUSH); |
@@ -179,7 +179,7 @@ DesktopAutomationHandler.prototype = { |
}, |
/** |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onAriaAttributeChanged: function(evt) { |
if (evt.target.state.editable) |
@@ -188,7 +188,7 @@ DesktopAutomationHandler.prototype = { |
}, |
/** |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onHover: function(evt) { |
if (ChromeVoxState.instance.currentRange && |
@@ -200,18 +200,18 @@ DesktopAutomationHandler.prototype = { |
/** |
* Makes an announcement without changing focus. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onActiveDescendantChanged: function(evt) { |
if (!evt.target.activeDescendant || !evt.target.state.focused) |
return; |
- this.onEventDefault(new chrome.automation.AutomationEvent( |
+ this.onEventDefault(new ChromeVoxAutomationEvent( |
EventType.focus, evt.target.activeDescendant, evt.eventFrom)); |
}, |
/** |
* Makes an announcement without changing focus. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onAlert: function(evt) { |
var node = evt.target; |
@@ -225,7 +225,7 @@ DesktopAutomationHandler.prototype = { |
/** |
* Provides all feedback once a checked state changed event fires. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onCheckedStateChanged: function(evt) { |
if (!AutomationPredicate.checkable(evt.target)) |
@@ -233,13 +233,13 @@ DesktopAutomationHandler.prototype = { |
Output.forceModeForNextSpeechUtterance(cvox.QueueMode.CATEGORY_FLUSH); |
this.onEventIfInRange( |
- new chrome.automation.AutomationEvent( |
+ new ChromeVoxAutomationEvent( |
EventType.checkedStateChanged, evt.target, evt.eventFrom)); |
}, |
/** |
* Provides all feedback once a focus event fires. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onFocus: function(evt) { |
// Invalidate any previous editable text handler state. |
@@ -279,13 +279,13 @@ DesktopAutomationHandler.prototype = { |
return; |
} |
- this.onEventDefault(new chrome.automation.AutomationEvent( |
+ this.onEventDefault(new ChromeVoxAutomationEvent( |
EventType.focus, node, evt.eventFrom)); |
}, |
/** |
* Provides all feedback once a load complete event fires. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onLoadComplete: function(evt) { |
chrome.automation.getFocus(function(focus) { |
@@ -328,7 +328,7 @@ DesktopAutomationHandler.prototype = { |
/** |
* Provides all feedback once a text changed event fires. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onTextChanged: function(evt) { |
if (evt.target.state.editable) |
@@ -337,7 +337,7 @@ DesktopAutomationHandler.prototype = { |
/** |
* Provides all feedback once a text selection changed event fires. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onTextSelectionChanged: function(evt) { |
if (evt.target.state.editable) |
@@ -346,7 +346,7 @@ DesktopAutomationHandler.prototype = { |
/** |
* Provides all feedback once a change event in a text field fires. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
* @private |
*/ |
onEditableChanged_: function(evt) { |
@@ -387,7 +387,7 @@ DesktopAutomationHandler.prototype = { |
/** |
* Provides all feedback once a value changed event fires. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onValueChanged: function(evt) { |
// Delegate to the edit text handler if this is an editable. |
@@ -421,7 +421,7 @@ DesktopAutomationHandler.prototype = { |
/** |
* Handle updating the active indicator when the document scrolls. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onScrollPositionChanged: function(evt) { |
var currentRange = ChromeVoxState.instance.currentRange; |
@@ -430,7 +430,7 @@ DesktopAutomationHandler.prototype = { |
}, |
/** |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onSelection: function(evt) { |
// Invalidate any previous editable text handler state since some nodes, |
@@ -460,7 +460,7 @@ DesktopAutomationHandler.prototype = { |
/** |
* Provides all feedback once a menu start event fires. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onMenuStart: function(evt) { |
ChromeVoxState.instance.markCurrentRange(); |
@@ -469,7 +469,7 @@ DesktopAutomationHandler.prototype = { |
/** |
* Provides all feedback once a menu end event fires. |
- * @param {!AutomationEvent} evt |
+ * @param {!AutomationEvent|!ChromeVoxAutomationEvent} evt |
*/ |
onMenuEnd: function(evt) { |
this.onEventDefault(evt); |
@@ -479,7 +479,7 @@ DesktopAutomationHandler.prototype = { |
chrome.automation.getFocus(function(focus) { |
if (focus) { |
this.onFocus( |
- new chrome.automation.AutomationEvent( |
+ new ChromeVoxAutomationEvent( |
EventType.focus, focus, 'page')); |
} |
}.bind(this)); |