| 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 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 description['Version'] = chrome.app.getDetails().version; | 171 description['Version'] = chrome.app.getDetails().version; |
| 172 description['Reproduction Steps'] = '%0a1.%0a2.%0a3.'; | 172 description['Reproduction Steps'] = '%0a1.%0a2.%0a3.'; |
| 173 for (var key in description) | 173 for (var key in description) |
| 174 url += key + ':%20' + description[key] + '%0a'; | 174 url += key + ':%20' + description[key] + '%0a'; |
| 175 chrome.tabs.create({url: url}); | 175 chrome.tabs.create({url: url}); |
| 176 return false; | 176 return false; |
| 177 case 'toggleBrailleCaptions': | 177 case 'toggleBrailleCaptions': |
| 178 cvox.BrailleCaptionsBackground.setActive( | 178 cvox.BrailleCaptionsBackground.setActive( |
| 179 !cvox.BrailleCaptionsBackground.isEnabled()); | 179 !cvox.BrailleCaptionsBackground.isEnabled()); |
| 180 return false; | 180 return false; |
| 181 case 'toggleBrailleTable': |
| 182 var brailleTableType = localStorage['brailleTableType']; |
| 183 var output = ''; |
| 184 if (brailleTableType == 'brailleTable6') { |
| 185 brailleTableType = 'brailleTable8'; |
| 186 |
| 187 // This label reads "switch to 8 dot braille". |
| 188 output = '@OPTIONS_BRAILLE_TABLE_TYPE_6'; |
| 189 } else { |
| 190 brailleTableType = 'brailleTable6'; |
| 191 |
| 192 // This label reads "switch to 6 dot braille". |
| 193 output = '@OPTIONS_BRAILLE_TABLE_TYPE_8'; |
| 194 } |
| 195 |
| 196 localStorage['brailleTable'] = localStorage[brailleTableType]; |
| 197 localStorage['brailleTableType'] = brailleTableType; |
| 198 cvox.BrailleBackground.getInstance().getTranslatorManager().refresh( |
| 199 localStorage[brailleTableType]); |
| 200 new Output().format(output).go(); |
| 201 return false; |
| 181 case 'toggleChromeVoxVersion': | 202 case 'toggleChromeVoxVersion': |
| 182 if (!ChromeVoxState.instance.toggleNext()) | 203 if (!ChromeVoxState.instance.toggleNext()) |
| 183 return false; | 204 return false; |
| 184 if (ChromeVoxState.instance.currentRange) { | 205 if (ChromeVoxState.instance.currentRange) { |
| 185 ChromeVoxState.instance.navigateToRange( | 206 ChromeVoxState.instance.navigateToRange( |
| 186 ChromeVoxState.instance.currentRange); | 207 ChromeVoxState.instance.currentRange); |
| 187 } | 208 } |
| 188 break; | 209 break; |
| 189 case 'help': | 210 case 'help': |
| 190 (new PanelCommand(PanelCommandType.TUTORIAL)).send(); | 211 (new PanelCommand(PanelCommandType.TUTORIAL)).send(); |
| (...skipping 663 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 854 if (imageNode.imageDataUrl) { | 875 if (imageNode.imageDataUrl) { |
| 855 var event = new CustomAutomationEvent( | 876 var event = new CustomAutomationEvent( |
| 856 EventType.IMAGE_FRAME_UPDATED, imageNode, 'page'); | 877 EventType.IMAGE_FRAME_UPDATED, imageNode, 'page'); |
| 857 CommandHandler.onImageFrameUpdated_(event); | 878 CommandHandler.onImageFrameUpdated_(event); |
| 858 } else { | 879 } else { |
| 859 imageNode.getImageData(0, 0); | 880 imageNode.getImageData(0, 0); |
| 860 } | 881 } |
| 861 }; | 882 }; |
| 862 | 883 |
| 863 }); // goog.scope | 884 }); // goog.scope |
| OLD | NEW |