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

Side by Side Diff: ui/keyboard/resources/elements/kb-keyboard.js

Issue 259183003: Disable sounds in the virtual keyboard. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 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 | Annotate | Revision Log
« no previous file with comments | « ui/keyboard/resources/constants.js ('k') | no next file » | 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 * 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
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
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 });
OLDNEW
« no previous file with comments | « ui/keyboard/resources/constants.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698