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

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

Issue 2826423003: Expand Chrome OS ARC support to create one tree source per package (Closed)
Patch Set: One tree per app. Created 3 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/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 d698bb099177025774d6970a6778a933a4395465..8e5541a98d83e897e1e95fbc12253b12c2c29617 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
@@ -51,6 +51,8 @@ DesktopAutomationHandler = function(node) {
this.onAriaAttributeChanged);
this.addListener_(EventType.AUTOCORRECTION_OCCURED,
this.onEventIfInRange);
+ this.addListener_(EventType.BLUR,
+ this.onBlur);
this.addListener_(EventType.CHECKED_STATE_CHANGED,
this.onCheckedStateChanged);
this.addListener_(EventType.CHILDREN_CHANGED,
@@ -243,6 +245,14 @@ DesktopAutomationHandler.prototype = {
new Output().withSpeechAndBraille(range, null, evt.type).go();
},
+ onBlur: function(evt) {
+ // Nullify focus if it no longer exists.
+ chrome.automation.getFocus(function(focus) {
+ if (!focus)
+ ChromeVoxState.instance.setCurrentRange(null);
+ });
+ },
+
/**
* Provides all feedback once a checked state changed event fires.
* @param {!AutomationEvent} evt
@@ -318,6 +328,7 @@ DesktopAutomationHandler.prototype = {
this.onEventDefault(event);
},
+
yawano 2017/04/25 09:29:23 nit: unnecessary blank line
David Tseng 2017/04/25 22:48:03 Done.
/**
* Provides all feedback once a load complete event fires.
* @param {!AutomationEvent} evt

Powered by Google App Engine
This is Rietveld 408576698