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 * The repeat delay in milliseconds before a key starts repeating. Use the | 6 * The repeat delay in milliseconds before a key starts repeating. Use the |
7 * same rate as Chromebook. | 7 * same rate as Chromebook. |
8 * (See chrome/browser/chromeos/language_preferences.cc) | 8 * (See chrome/browser/chromeos/language_preferences.cc) |
9 * @const | 9 * @const |
10 * @type {number} | 10 * @type {number} |
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
763 if (this.lastPressedKey) | 763 if (this.lastPressedKey) |
764 this.lastPressedKey.classList.remove('active'); | 764 this.lastPressedKey.classList.remove('active'); |
765 } | 765 } |
766 }, | 766 }, |
767 | 767 |
768 /** | 768 /** |
769 * Plays the specified sound. | 769 * Plays the specified sound. |
770 * @param {Sound} sound The id of the audio tag. | 770 * @param {Sound} sound The id of the audio tag. |
771 */ | 771 */ |
772 playSound: function(sound) { | 772 playSound: function(sound) { |
773 if (!sound || sound == Sound.NONE) | 773 if (!SOUND_ENABLED || !sound || sound == Sound.NONE) |
774 return; | 774 return; |
775 var pool = this.sounds[sound]; | 775 var pool = this.sounds[sound]; |
776 if (!pool) { | 776 if (!pool) { |
777 console.error("Cannot find audio tag: " + sound); | 777 console.error("Cannot find audio tag: " + sound); |
778 return; | 778 return; |
779 } | 779 } |
780 // Search the sound pool for a free resource. | 780 // Search the sound pool for a free resource. |
781 for (var i = 0; i < pool.length; i++) { | 781 for (var i = 0; i < pool.length; i++) { |
782 if (pool[i].paused) { | 782 if (pool[i].paused) { |
783 pool[i].play(); | 783 pool[i].play(); |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
967 keyboardLoaded(); | 967 keyboardLoaded(); |
968 return true; | 968 return true; |
969 } | 969 } |
970 } | 970 } |
971 } | 971 } |
972 if (keysetsLoaded) | 972 if (keysetsLoaded) |
973 console.error('No default keyset found for ' + this.layout); | 973 console.error('No default keyset found for ' + this.layout); |
974 return false; | 974 return false; |
975 } | 975 } |
976 }); | 976 }); |
OLD | NEW |