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

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

Issue 1942683005: Refactor event handler classes to make it easier to add new event type listeners. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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 943e0cb64b165555ca265af4ddb13558604d5cb4..87fba15b4a48c75dd582bc2a1c32b7cddb6edec1 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
@@ -26,8 +26,10 @@ TabsAutomationHandler = function(tabRoot) {
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.focused)
- this.onLoadComplete({target: tabRoot, type: EventType.loadComplete});
+ if (tabRoot.state.focused) {
+ this.onLoadComplete(
+ new chrome.automation.AutomationEvent(EventType.loadComplete, tabRoot));
+ }
};
TabsAutomationHandler.prototype = {
@@ -42,7 +44,8 @@ TabsAutomationHandler.prototype = {
onLoadComplete: function(evt) {
ChromeVoxState.instance.refreshMode(evt.target.docUrl);
var focused = evt.target.find({state: {focused: true}}) || evt.target;
- this.onFocus({target: focused, type: EventType.focus});
+ this.onFocus(new chrome.automation.AutomationEvent(
+ EventType.focus, focused));
}
};

Powered by Google App Engine
This is Rietveld 408576698