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 8b3433604435810b9b08e9816c0d3e7bdc88f161..752c3c82ca1acab9071037d5bff897fe11220b2d 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 |
@@ -49,6 +49,10 @@ DesktopAutomationHandler = function(node) { |
type: chrome.automation.EventType.loadComplete}); |
} |
} |
+ |
+ var focus = chrome.automation.getFocus(); |
+ if (focus) |
+ this.onFocus({target: focus, type: 'focus'}); |
}; |
DesktopAutomationHandler.prototype = { |
@@ -159,12 +163,17 @@ DesktopAutomationHandler.prototype = { |
* @param {Object} evt |
*/ |
onLoadComplete: function(evt) { |
+ console.log('onLoadComplete 1'); |
+ console.log('onLoadComplete 2'); |
+ |
ChromeVoxState.instance.refreshMode(evt.target.docUrl); |
+ console.log('onLoadComplete 3'); |
// Don't process nodes inside of web content if ChromeVox Next is inactive. |
if (evt.target.root.role != RoleType.desktop && |
ChromeVoxState.instance.mode === ChromeVoxMode.CLASSIC) |
return; |
+ console.log('onLoadComplete 4'); |
// If initial focus was already placed on this page (e.g. if a user starts |
// tabbing before load complete), then don't move ChromeVox's position on |
@@ -172,10 +181,14 @@ DesktopAutomationHandler.prototype = { |
if (ChromeVoxState.instance.currentRange && |
ChromeVoxState.instance.currentRange.start.node.root == evt.target) |
return; |
+ console.log('onLoadComplete 5'); |
ChromeVoxState.instance.setCurrentRange(cursors.Range.fromNode(evt.target)); |
+ console.log('onLoadComplete 6'); |
+ |
new Output().withRichSpeechAndBraille( |
ChromeVoxState.instance.currentRange, null, evt.type).go(); |
+ console.log('onLoadComplete 7'); |
}, |
/** @override */ |