Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(236)

Side by Side Diff: chrome/browser/resources/chromeos/chromevox/cvox2/background/command_handler.js

Issue 2768703002: Wire up an api to darken screen for accessibility (Closed)
Patch Set: Rebase. Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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.accessibilityPrivate.darkenScreen(true);
197 new Output().format('@darken_screen').go();
198 break;
199 case 'undarkenScreen':
200 chrome.accessibilityPrivate.darkenScreen(false);
201 new Output().format('@undarken_screen').go();
202 break;
195 default: 203 default:
196 break; 204 break;
197 } 205 }
198 206
199 // Require a current range. 207 // Require a current range.
200 if (!ChromeVoxState.instance.currentRange_) 208 if (!ChromeVoxState.instance.currentRange_)
201 return true; 209 return true;
202 210
203 // Next/classic compat commands hereafter. 211 // Next/classic compat commands hereafter.
204 if (ChromeVoxState.instance.mode == ChromeVoxMode.CLASSIC) 212 if (ChromeVoxState.instance.mode == ChromeVoxMode.CLASSIC)
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
836 if (imageNode.imageDataUrl) { 844 if (imageNode.imageDataUrl) {
837 var event = new CustomAutomationEvent( 845 var event = new CustomAutomationEvent(
838 EventType.IMAGE_FRAME_UPDATED, imageNode, 'page'); 846 EventType.IMAGE_FRAME_UPDATED, imageNode, 'page');
839 CommandHandler.onImageFrameUpdated_(event); 847 CommandHandler.onImageFrameUpdated_(event);
840 } else { 848 } else {
841 imageNode.getImageData(0, 0); 849 imageNode.getImageData(0, 0);
842 } 850 }
843 }; 851 };
844 852
845 }); // goog.scope 853 }); // goog.scope
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698