Chromium Code Reviews| 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 |