Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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.forceActive(); | |
|
dmazzoni
2015/04/29 16:48:39
How about forceChromeVoxNextActive or forceDesktop
David Tseng
2015/04/29 18:42:07
Done.
| |
| 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 Loading... | |
| 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); |
| OLD | NEW |