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

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

Issue 1107343006: Add a method to enable ChromeVox Next easily for the current run. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 7 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
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 options page. 6 * @fileoverview ChromeVox options page.
7 * 7 *
8 */ 8 */
9 9
10 goog.provide('cvox.OptionsPage'); 10 goog.provide('cvox.OptionsPage');
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
91 } 91 }
92 }); 92 });
93 93
94 $('selectKeys').addEventListener( 94 $('selectKeys').addEventListener(
95 'click', cvox.OptionsPage.reset, false); 95 'click', cvox.OptionsPage.reset, false);
96 96
97 if (cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.WML)) { 97 if (cvox.PlatformUtil.matchesPlatform(cvox.PlatformFilter.WML)) {
98 $('version').textContent = 98 $('version').textContent =
99 chrome.app.getDetails().version; 99 chrome.app.getDetails().version;
100 } 100 }
101
102 // Temporary secret way to enable ChromeVox Next for the current run of
103 // ChromeVox.
104 var next = 'next';
105 document.body.addEventListener('keypress', function(evt) {
106 if (next === undefined) {
107 return;
108 }
109 var key = String.fromCharCode(evt.charCode);
110 if (next[0] === key) {
111 next = next.slice(1);
112
113 if (next === '') {
114 cvox.OptionsPage.speak(
115 'You are now running ChromeVox Next; open a new tab to start',
116 cvox.QueueMode.FLUSH);
117 next = undefined;
118 chrome.extension.getBackgroundPage()['global']
119 .backgroundObj.forceChromeVoxNextActive();
120 }
121 } else {
122 next = 'next';
123 }
124 return true;
125 }, true);
101 }; 126 };
102 127
103 /** 128 /**
104 * Update the value of controls to match the current preferences. 129 * Update the value of controls to match the current preferences.
105 * This happens if the user presses a key in a tab that changes a 130 * This happens if the user presses a key in a tab that changes a
106 * pref. 131 * pref.
107 */ 132 */
108 cvox.OptionsPage.update = function() { 133 cvox.OptionsPage.update = function() {
109 var prefs = cvox.OptionsPage.prefs.getPrefs(); 134 var prefs = cvox.OptionsPage.prefs.getPrefs();
110 for (var key in prefs) { 135 for (var key in prefs) {
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after
564 /** 589 /**
565 * @return {cvox.BrailleTranslatorManager} 590 * @return {cvox.BrailleTranslatorManager}
566 */ 591 */
567 cvox.OptionsPage.getBrailleTranslatorManager = function() { 592 cvox.OptionsPage.getBrailleTranslatorManager = function() {
568 return chrome.extension.getBackgroundPage()['braille_translator_manager']; 593 return chrome.extension.getBackgroundPage()['braille_translator_manager'];
569 }; 594 };
570 595
571 document.addEventListener('DOMContentLoaded', function() { 596 document.addEventListener('DOMContentLoaded', function() {
572 cvox.OptionsPage.init(); 597 cvox.OptionsPage.init();
573 }, false); 598 }, false);
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/resources/chromeos/chromevox/cvox2/background/background.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698