Chromium Code Reviews| 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 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 185 ChromeVoxState.instance.navigateToRange( | 185 ChromeVoxState.instance.navigateToRange( |
| 186 ChromeVoxState.instance.currentRange); | 186 ChromeVoxState.instance.currentRange); |
| 187 } | 187 } |
| 188 break; | 188 break; |
| 189 case 'help': | 189 case 'help': |
| 190 (new PanelCommand(PanelCommandType.TUTORIAL)).send(); | 190 (new PanelCommand(PanelCommandType.TUTORIAL)).send(); |
| 191 return false; | 191 return false; |
| 192 case 'showNextUpdatePage': | 192 case 'showNextUpdatePage': |
| 193 (new PanelCommand(PanelCommandType.UPDATE_NOTES)).send(); | 193 (new PanelCommand(PanelCommandType.UPDATE_NOTES)).send(); |
| 194 return false; | 194 return false; |
| 195 case 'darkenScreen': | |
| 196 chrome.automation.getDesktop(function(desktop) { | |
| 197 desktop.toggleDarkenScreen(false); | |
|
dmazzoni
2017/03/22 21:40:48
Why call it twice?
David Tseng
2017/03/22 22:51:38
The other end of the dbus message is sticky. So, i
| |
| 198 desktop.toggleDarkenScreen(true); | |
| 199 }); | |
| 200 new Output().format('@darken_screen').go(); | |
| 201 break; | |
| 202 case 'undarkenScreen': | |
| 203 chrome.automation.getDesktop(function(desktop) { | |
| 204 desktop.toggleDarkenScreen(true); | |
| 205 desktop.toggleDarkenScreen(false); | |
| 206 }); | |
| 207 new Output().format('@undarken_screen').go(); | |
| 208 break; | |
| 195 default: | 209 default: |
| 196 break; | 210 break; |
| 197 } | 211 } |
| 198 | 212 |
| 199 // Require a current range. | 213 // Require a current range. |
| 200 if (!ChromeVoxState.instance.currentRange_) | 214 if (!ChromeVoxState.instance.currentRange_) |
| 201 return true; | 215 return true; |
| 202 | 216 |
| 203 // Next/classic compat commands hereafter. | 217 // Next/classic compat commands hereafter. |
| 204 if (ChromeVoxState.instance.mode == ChromeVoxMode.CLASSIC) | 218 if (ChromeVoxState.instance.mode == ChromeVoxMode.CLASSIC) |
| (...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 836 if (imageNode.imageDataUrl) { | 850 if (imageNode.imageDataUrl) { |
| 837 var event = new CustomAutomationEvent( | 851 var event = new CustomAutomationEvent( |
| 838 EventType.IMAGE_FRAME_UPDATED, imageNode, 'page'); | 852 EventType.IMAGE_FRAME_UPDATED, imageNode, 'page'); |
| 839 CommandHandler.onImageFrameUpdated_(event); | 853 CommandHandler.onImageFrameUpdated_(event); |
| 840 } else { | 854 } else { |
| 841 imageNode.getImageData(0, 0); | 855 imageNode.getImageData(0, 0); |
| 842 } | 856 } |
| 843 }; | 857 }; |
| 844 | 858 |
| 845 }); // goog.scope | 859 }); // goog.scope |
| OLD | NEW |