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..4873e593f7b8681489fbdcd33e1eebff479fb536 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 |