| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 /** | 5 /** |
| 6 * @fileoverview Handles automation from a desktop automation node. | 6 * @fileoverview Handles automation from a desktop automation node. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 goog.provide('DesktopAutomationHandler'); | 9 goog.provide('DesktopAutomationHandler'); |
| 10 | 10 |
| (...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 142 /** | 142 /** |
| 143 * @param {!AutomationEvent} evt | 143 * @param {!AutomationEvent} evt |
| 144 */ | 144 */ |
| 145 onEventIfInRange: function(evt) { | 145 onEventIfInRange: function(evt) { |
| 146 if (!this.shouldOutput_(evt)) | 146 if (!this.shouldOutput_(evt)) |
| 147 return; | 147 return; |
| 148 | 148 |
| 149 var prev = ChromeVoxState.instance.currentRange; | 149 var prev = ChromeVoxState.instance.currentRange; |
| 150 if (prev.contentEquals(cursors.Range.fromNode(evt.target)) || | 150 if (prev.contentEquals(cursors.Range.fromNode(evt.target)) || |
| 151 evt.target.state.focused) { | 151 evt.target.state.focused) { |
| 152 // Category flush here since previous focus events via navigation can |
| 153 // cause double speak. |
| 154 Output.forceModeForNextSpeechUtterance(cvox.QueueMode.CATEGORY_FLUSH); |
| 155 |
| 152 // Intentionally skip setting range. | 156 // Intentionally skip setting range. |
| 153 new Output() | 157 new Output() |
| 154 .withRichSpeechAndBraille(cursors.Range.fromNode(evt.target), | 158 .withRichSpeechAndBraille(cursors.Range.fromNode(evt.target), |
| 155 prev, | 159 prev, |
| 156 Output.EventType.NAVIGATE) | 160 Output.EventType.NAVIGATE) |
| 157 .go(); | 161 .go(); |
| 158 } | 162 } |
| 159 }, | 163 }, |
| 160 | 164 |
| 161 /** | 165 /** |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 514 DesktopAutomationHandler.init_ = function() { | 518 DesktopAutomationHandler.init_ = function() { |
| 515 chrome.automation.getDesktop(function(desktop) { | 519 chrome.automation.getDesktop(function(desktop) { |
| 516 ChromeVoxState.desktopAutomationHandler = | 520 ChromeVoxState.desktopAutomationHandler = |
| 517 new DesktopAutomationHandler(desktop); | 521 new DesktopAutomationHandler(desktop); |
| 518 }); | 522 }); |
| 519 }; | 523 }; |
| 520 | 524 |
| 521 DesktopAutomationHandler.init_(); | 525 DesktopAutomationHandler.init_(); |
| 522 | 526 |
| 523 }); // goog.scope | 527 }); // goog.scope |
| OLD | NEW |