| OLD | NEW |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 ChromeVox commands. | 6 * @fileoverview ChromeVox commands. |
| 7 */ | 7 */ |
| 8 | 8 |
| 9 goog.provide('CommandHandler'); | 9 goog.provide('CommandHandler'); |
| 10 | 10 |
| (...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 188 (new PanelCommand(PanelCommandType.TUTORIAL)).send(); | 188 (new PanelCommand(PanelCommandType.TUTORIAL)).send(); |
| 189 return false; | 189 return false; |
| 190 case 'showNextUpdatePage': | 190 case 'showNextUpdatePage': |
| 191 (new PanelCommand(PanelCommandType.UPDATE_NOTES)).send(); | 191 (new PanelCommand(PanelCommandType.UPDATE_NOTES)).send(); |
| 192 return false; | 192 return false; |
| 193 default: | 193 default: |
| 194 break; | 194 break; |
| 195 } | 195 } |
| 196 | 196 |
| 197 // Require a current range. | 197 // Require a current range. |
| 198 if (!ChromeVoxState.instance.currentRange_) | 198 if (!ChromeVoxState.instance.currentRange_ || |
| 199 return true; | 199 !ChromeVoxState.instance.currentRange_.isValid()) { |
| 200 cvox.ChromeVox.tts.speak(Msgs.getMsg('no_focus'), cvox.QueueMode.FLUSH); |
| 201 return false; |
| 202 } |
| 200 | 203 |
| 201 // Next/classic compat commands hereafter. | 204 // Next/classic compat commands hereafter. |
| 202 if (ChromeVoxState.instance.mode == ChromeVoxMode.CLASSIC || | 205 if (ChromeVoxState.instance.mode == ChromeVoxMode.CLASSIC || |
| 203 ChromeVoxState.instance.mode == ChromeVoxMode.NEXT_COMPAT) | 206 ChromeVoxState.instance.mode == ChromeVoxMode.NEXT_COMPAT) |
| 204 return true; | 207 return true; |
| 205 | 208 |
| 206 var current = ChromeVoxState.instance.currentRange_; | 209 var current = ChromeVoxState.instance.currentRange_; |
| 207 var dir = Dir.FORWARD; | 210 var dir = Dir.FORWARD; |
| 208 var pred = null; | 211 var pred = null; |
| 209 var predErrorMsg = undefined; | 212 var predErrorMsg = undefined; |
| (...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 768 break; | 771 break; |
| 769 } | 772 } |
| 770 if (announcement) { | 773 if (announcement) { |
| 771 cvox.ChromeVox.tts.speak( | 774 cvox.ChromeVox.tts.speak( |
| 772 announcement, cvox.QueueMode.FLUSH, | 775 announcement, cvox.QueueMode.FLUSH, |
| 773 cvox.AbstractTts.PERSONALITY_ANNOTATION); | 776 cvox.AbstractTts.PERSONALITY_ANNOTATION); |
| 774 } | 777 } |
| 775 }; | 778 }; |
| 776 | 779 |
| 777 }); // goog.scope | 780 }); // goog.scope |
| OLD | NEW |