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

Unified Diff: chrome/browser/resources/chromeos/switch_access/switch_access.js

Issue 2872023005: Correctly follows focus and moves to valid node when current becomes invalid (Closed)
Patch Set: Responded to comments Created 3 years, 7 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
« no previous file with comments | « chrome/browser/resources/chromeos/switch_access/compiled_resources2.gyp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/resources/chromeos/switch_access/switch_access.js
diff --git a/chrome/browser/resources/chromeos/switch_access/switch_access.js b/chrome/browser/resources/chromeos/switch_access/switch_access.js
index c2e2fa29c518568d9aae408b4aa7557aae060e5e..58f19f73bbf414fcd624f91b91f218dc5e8eeafc 100644
--- a/chrome/browser/resources/chromeos/switch_access/switch_access.js
+++ b/chrome/browser/resources/chromeos/switch_access/switch_access.js
@@ -53,7 +53,10 @@ SwitchAccess.prototype = {
this.switchAccessPrefs = new SwitchAccessPrefs();
this.autoScanManager_ = new AutoScanManager(this);
this.keyboardHandler_ = new KeyboardHandler(this);
- this.automationManager_ = new AutomationManager();
+
+ chrome.automation.getDesktop(function(desktop) {
+ this.automationManager_ = new AutomationManager(desktop);
+ }.bind(this));
document.addEventListener(
'prefsUpdate', this.handlePrefsUpdate_.bind(this));
@@ -67,7 +70,8 @@ SwitchAccess.prototype = {
* @override
*/
moveToNode: function(doNext) {
- this.automationManager_.moveToNode(doNext);
+ if (this.automationManager_)
+ this.automationManager_.moveToNode(doNext);
},
/**
@@ -76,7 +80,8 @@ SwitchAccess.prototype = {
* @override
*/
selectCurrentNode: function() {
- this.automationManager_.selectCurrentNode();
+ if (this.automationManager_)
+ this.automationManager_.selectCurrentNode();
},
/**
@@ -125,7 +130,8 @@ SwitchAccess.prototype = {
* @override
*/
debugMoveToNext: function() {
- this.automationManager_.debugMoveToNext();
+ if (this.automationManager_)
+ this.automationManager_.debugMoveToNext();
},
/**
@@ -134,7 +140,8 @@ SwitchAccess.prototype = {
* @override
*/
debugMoveToPrevious: function() {
- this.automationManager_.debugMoveToPrevious();
+ if (this.automationManager_)
+ this.automationManager_.debugMoveToPrevious();
},
/**
@@ -143,7 +150,8 @@ SwitchAccess.prototype = {
* @override
*/
debugMoveToFirstChild: function() {
- this.automationManager_.debugMoveToFirstChild();
+ if (this.automationManager_)
+ this.automationManager_.debugMoveToFirstChild();
},
/**
@@ -152,6 +160,7 @@ SwitchAccess.prototype = {
* @override
*/
debugMoveToParent: function() {
- this.automationManager_.debugMoveToParent();
+ if (this.automationManager_)
+ this.automationManager_.debugMoveToParent();
}
};
« no previous file with comments | « chrome/browser/resources/chromeos/switch_access/compiled_resources2.gyp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698